America’s Got Talent: Sofia Vergara gets a big surprise from Modern Family co-star Ed O’Neil

Sofia Vergara was shocked by a surprise guest to the America’s Got Talent set during Wednesday’s quarterfinals results show.

Ed O’Neill, the 74-year-old actor who played her husband Jay Pritchett for 11 seasons on Modern Family, thrilled the actress by showing up on a giant TV screen.

‘My husband!’ screamed Sofia, 48. ‘Where are you? I miss you so much!’

Surprise: Sofia Vergara was shocked by a surprise guest to the America’s Got Talent set during Wednesday’s quarterfinals results show

Ed from Hawaii: Ed O'Neill, the 74-year-old actor who played her husband Jay Pritchett for 11 seasons on Modern Family, thrilled the actress by showing up on a giant TV screen

Ed from Hawaii: Ed O’Neill, the 74-year-old actor who played her husband Jay Pritchett for 11 seasons on Modern Family, thrilled the actress by showing up on a giant TV screen

‘I’m in Hawaii!’ replied Ed, who was introduced only as ‘Ed from Hawaii.’

‘My God, Ed, why are you still there?’ Sofia whined. ‘Come back!’

Ed was appearing on AGT to take part in a segment called ‘America’s Got Questions,’ in which viewers were able to ask the judges whatever they wanted.

Hawaii call: 'I'm in Hawaii!' replied Ed, who was introduced only as 'Ed from Hawaii'

Hawaii call: ‘I’m in Hawaii!’ replied Ed, who was introduced only as ‘Ed from Hawaii’

Questions: Ed was appearing on AGT to take part in a segment called 'America's Got Questions,' in which viewers were able to ask the judges whatever they wanted

Questions: Ed was appearing on AGT to take part in a segment called ‘America’s Got Questions,’ in which viewers were able to ask the judges whatever they wanted

He had just one question for Sofia.

‘How did you manage to get the dream job you’ve always wanted, where you get to sit the entire time, and someone else does all the work?’ Ed asked.

‘I don’t know, Ed,’ Sofia answered, laughing. ‘God always is so good to me!’ The onetime Gloria Delgado-Pritchett then told Ed proudly that she hadn’t fallen on the AGT set yet.

Question: 'How did you manage to get the dream job you've always wanted, where you get to sit the entire time, and someone else does all the work?' Ed asked

Question: ‘How did you manage to get the dream job you’ve always wanted, where you get to sit the entire time, and someone else does all the work?’ Ed asked

Dream job: 'I don't know, Ed,' Sofia answered, laughing. 'God always is so good to me!' The onetime Gloria Delgado-Pritchett then told Ed proudly that she hadn't fallen on the AGT set yet

Dream job: ‘I don’t know, Ed,’ Sofia answered, laughing. ‘God always is so good to me!’ The onetime Gloria Delgado-Pritchett then told Ed proudly that she hadn’t fallen on the AGT set yet

When the judges asked Ed if Sofia tended to fall often, he laughed.

‘You guys have never seen her fall?’ Ed asked, astounded. ‘It’s like a puppet, and somebody cuts the strings. Straight down.’

‘I don’t go forward, or sideways, I just go down—all the time with him,’ Sofia revealed.

Puppet: 'You guys have never seen her fall?' Ed asked, astounded. 'It's like a puppet, and somebody cuts the strings. Straight down'

Puppet: ‘You guys have never seen her fall?’ Ed asked, astounded. ‘It’s like a puppet, and somebody cuts the strings. Straight down’

Down: 'I don't go forward, or sideways, I just go down—all the time with him,' Sofia revealed

Down: ‘I don’t go forward, or sideways, I just go down—all the time with him,’ Sofia revealed

Ed asked the judges if they’d ever seen Sofia’s ventriloquist act with ‘Uncle Grumpy,’ but the actress allowed that that would have to be a ‘little surprise’ for the future.

Ed told the judges he loved the show, and the AGT cameras pulled back to show TV screens with viewers holding signs with phrases like, ‘We love Terry Crews,’ and ‘Get well, Simon.’

Judge Simon Cowell, 60, was home recovering from an e-bike accident he’d had two weeks ago, which necessitated major surgery.

Surprise: Ed asked the judges if they'd ever seen Sofia's ventriloquist act with 'Uncle Grumpy,' but the actress allowed that that would have to be a 'little surprise' for the future

Surprise: Ed asked the judges if they’d ever seen Sofia’s ventriloquist act with ‘Uncle Grumpy,’ but the actress allowed that that would have to be a ‘little surprise’ for the future

‘Man, I hope Simon’s okay,’ Ed offered, before he signed off.

‘Unlike Sofia, when he falls, it’s a bigger deal,’ cracked judge Howie Mandel, 64.

Simon himself did show up in a pre-taped segment, answering trivia questions about new judge Sofia along with Howie and Heidi Klum, 47.

Jokes: 'Unlike Sofia, when he falls, it's a bigger deal,' cracked judge Howie Mandel, 64

Jokes: ‘Unlike Sofia, when he falls, it’s a bigger deal,’ cracked judge Howie Mandel, 64

In her answers, Sofia revealed that she used to prank people on the Modern Family set by hitting them with her prosthetic baby bump.

She also said that she named her son Manolo, 27, after a character in the 1983 movie Scarface, and that she trained for three years to be a dentist.

‘Imagine if you turned up and your dentist was Sofia Vergara,’ Simon mused. ‘It’d be like, ‘You know what? I’ll have a filling out a week.’

Pranks: In her answers, Sofia revealed that she used to prank people on the Modern Family set by hitting them with her prosthetic baby bump.

Pranks: In her answers, Sofia revealed that she used to prank people on the Modern Family set by hitting them with her prosthetic baby bump.

Scarface: She also said that she named her son Manolo, 27, after a character in the 1983 movie Scarface, and that she trained for three years to be a dentist.

Scarface: She also said that she named her son Manolo, 27, after a character in the 1983 movie Scarface, and that she trained for three years to be a dentist.

Scarface: She also said that she named her son Manolo, 27, after a character in the 1983 movie Scarface, and that she trained for three years to be a dentist.

With four weeks left to go before the AGT finale, there was stiff competition for the show’s $1 million prize and headlining gig at the Luxor Las Vegas hotel.

Just five of the week’s 11 acts would make it through to the semifinals—three chosen by viewers, one picked during the live Dunkin’ Save vote, and one selected by judges.

The first act through was Brazilian acrobat Alan Silva, who said he was ‘shaking and nervous’ to learn that he would be going to the live shows, and vowed not to let America down.

Alan the acrobat: The first act through was Brazilian acrobat Alan Silva, who said he was 'shaking and nervous' to learn that he would be going to the live shows, and vowed not to let America down

Alan the acrobat: The first act through was Brazilian acrobat Alan Silva, who said he was ‘shaking and nervous’ to learn that he would be going to the live shows, and vowed not to let America down

‘I am so happy for you,’ Sofia told Alan, who’d once broken his neck doing his act. ‘You’ve gone through a lot, and I hope that you enjoy this, and never forget all that you are living.’

Next through was singer Cristina Rae, a single mom from Nashville who cried ‘Hallelujah!’ when she heard the news, referencing the title of the Leonard Cohen song she’d sung Tuesday.

‘There wasn’t a doubt in my mind that you would continue,’ said Heidi, who’d given Cristina her Golden Buzzer during the AGT auditions. ‘I’ve heard that song so many times, but no one has sung it the way you have.’

So happy: 'I am so happy for you,' Sofia told Alan, who'd once broken his neck doing his act. 'You've gone through a lot, and I hope that you enjoy this, and never forget all that you are living'

So happy: 'I am so happy for you,' Sofia told Alan, who'd once broken his neck doing his act. 'You've gone through a lot, and I hope that you enjoy this, and never forget all that you are living'

So happy: ‘I am so happy for you,’ Sofia told Alan, who’d once broken his neck doing his act. ‘You’ve gone through a lot, and I hope that you enjoy this, and never forget all that you are living’

Cristina advances: Next through was singer Cristina Rae, a single mom from Nashville who cried 'Hallelujah!' when she heard the news, referencing the title of the Leonard Cohen song she'd sung Tuesday

Cristina advances: Next through was singer Cristina Rae, a single mom from Nashville who cried 'Hallelujah!' when she heard the news, referencing the title of the Leonard Cohen song she'd sung Tuesday

Cristina advances: Next through was singer Cristina Rae, a single mom from Nashville who cried ‘Hallelujah!’ when she heard the news, referencing the title of the Leonard Cohen song she’d sung Tuesday

No doubt: 'There wasn't a doubt in my mind that you would continue,' said Heidi, who'd given Cristina her Golden Buzzer during the AGT auditions. 'I've heard that song so many times, but no one has sung it the way you have'

No doubt: 'There wasn't a doubt in my mind that you would continue,' said Heidi, who'd given Cristina her Golden Buzzer during the AGT auditions. 'I've heard that song so many times, but no one has sung it the way you have'

No doubt: ‘There wasn’t a doubt in my mind that you would continue,’ said Heidi, who’d given Cristina her Golden Buzzer during the AGT auditions. ‘I’ve heard that song so many times, but no one has sung it the way you have’

Max Major, a Las Vegas-based mentalist who’d used subliminal imagery to trick Howie and the AGT TV viewers into drawing the same picture the night before, was third to go through.

Sofia admitted that Max might find the path to the finale challenging because he had to keep topping his earlier presentations to AGT, which were already so ‘amazing.’

The fourth act through was The W.A.F.F.L.E. Crew, a dance act from New York’s Bronx neighborhood that earned Simon’s Golden Buzzer during auditions.

Mentalist Max: Max Major, a Las Vegas-based mentalist who'd used subliminal imagery to trick Howie and the AGT TV viewers into drawing the same picture the night before, was third to go through

Mentalist Max: Max Major, a Las Vegas-based mentalist who’d used subliminal imagery to trick Howie and the AGT TV viewers into drawing the same picture the night before, was third to go through

Amazing: Sofia admitted that Max might find the path to the finale challenging because he had to keep topping his earlier presentations to AGT, which were already so 'amazing'

Amazing: Sofia admitted that Max might find the path to the finale challenging because he had to keep topping his earlier presentations to AGT, which were already so ‘amazing’

Dance crew: The fourth act through was The W.A.F.F.L.E. Crew, a dance act from New York's Bronx neighborhood that earned Simon's Golden Buzzer during auditions

Dance crew: The fourth act through was The W.A.F.F.L.E. Crew, a dance act from New York’s Bronx neighborhood that earned Simon’s Golden Buzzer during auditions

They were the winners of the Dunkin’ Save, in a vote show host Terry Crews, 52, called ‘one of the closest ever on AGT.’

‘It’s a weigh off our shoulders right now,’ a member of the group said. ‘I’m not gonna lie.’

Howie told the W.A.F.F.L.E. Crew their selection was ‘well-deserved, not only for your talent but for who you are as young men and what you want to do for your community.’

Weight: 'It's a weigh off our shoulders right now,' a member of the group said. 'I'm not gonna lie.'

Weight: ‘It’s a weigh off our shoulders right now,’ a member of the group said. ‘I’m not gonna lie.’

The last contestant to go forward was Malik DOPE Drummer, 27, from Washington, D.C., whom Heidi and Howie chose as their judges’ pick for his spectacular dance-drumming.

Sofia made an unsuccessful bid to keep Nolan Neal, the 39-year-old Nashville singer-songwriter who had moved the judges with his emotional story about a 24-year alcohol addiction.

The other contestants going home included Australian singers Annie Jones, 12, and Sheldon Riley; the contortionist group Bone Breakers; dance act Dance Town Family; and comedian Usama Siddiquee.

Dope: The last contestant to go forward was Malik DOPE Drummer, 27, from Washington, D.C., whom Heidi and Howie chose as their judges' pick for his spectacular dance-drumming

Dope: The last contestant to go forward was Malik DOPE Drummer, 27, from Washington, D.C., whom Heidi and Howie chose as their judges’ pick for his spectacular dance-drumming

Eliminated: Sofia made an unsuccessful bid to keep Nolan Neal, the 39-year-old Nashville singer-songwriter who had moved the judges with his emotional story about a 24-year alcohol addiction

Eliminated: Sofia made an unsuccessful bid to keep Nolan Neal, the 39-year-old Nashville singer-songwriter who had moved the judges with his emotional story about a 24-year alcohol addiction

NFL star-turned-magician Jon Dorenbos, 40, who made it to AGT’s top three in 2016, and starred on AGT: Champions last year, returned to perform a card trick for the audience.

The ‘America’s Got Questions’ segment gave AGT viewers a chance to interview the judges—and Ed wasn’t the only one with a surprising query.

Will, a 31-year-old university lecturer from Clemson, South Carolina, said he’d always wanted to be an AGT judge, and wondered if an actual judge could do something for him to assess.

Jon returns: NFL star-turned-magician Jon Dorenbos, 40, who made it to AGT's top three in 2016, and starred on AGT: Champions last year, returned to perform a card trick for the audience

Jon returns: NFL star-turned-magician Jon Dorenbos, 40, who made it to AGT's top three in 2016, and starred on AGT: Champions last year, returned to perform a card trick for the audience

Jon returns: NFL star-turned-magician Jon Dorenbos, 40, who made it to AGT’s top three in 2016, and starred on AGT: Champions last year, returned to perform a card trick for the audience

Home judge: Will, a 31-year-old university lecturer from Clemson, South Carolina, said he'd always wanted to be an AGT judge, and wondered if an actual judge could do something for him to assess

Home judge: Will, a 31-year-old university lecturer from Clemson, South Carolina, said he’d always wanted to be an AGT judge, and wondered if an actual judge could do something for him to assess

‘I have one talent,’ Sofia called out, closing one eye and opening the other widely, for eerie effect. ‘Can you do this?’

‘What are you doing with it?’ Heidi wondered.

‘I don’t know, but it does this thing when I want to,’ Sofia shared.

Will, who was drinking a Dunkin’ Donuts coffee and sitting behind a placard with his name, pressed a homemade Golden Buzzer for her while sprinkling confetti.

‘Will, you have too much free time,’ Howie teased.

Free time: 'Will, you have too much free time,' Howie teased

Free time: ‘Will, you have too much free time,’ Howie teased

Julie, a 46-year-old legal assistant from Ankeny, Iowa, asked Howie whether he would audition for AGT if he were just starting his stand-up career now.

‘No, I wouldn’t,’ the comic said. ‘Because anybody who knows me truly knows that my forte and my love is dance. So I think I’d be on World of Dance, and I think I’d make it to the finals. J. Lo has always been a fan and wanted me to tour with her, and I’ve never had the opportunity.’

KidJay, 20, from Detroit, Michigan, asked Terry how long he’d been popping his pecs for audiences, saying he’d been trying to do it, too.

‘When I was 13, I couldn’t get any dates,’ Terry admitted. ‘I was alone in my room, Saturday night, and I was like, ‘Man, another lonely night.’ And all of a sudden, my pec moved. And I looked down and the other one did it… and it’s so funny because I never stopped.’

America’s Got Talent returns next week on NBC.

Pec pop: KidJay, 20, from Detroit, Michigan, asked Terry how long he'd been popping his pecs for audiences, saying he'd been trying to do it, too

Pec pop: KidJay, 20, from Detroit, Michigan, asked Terry how long he’d been popping his pecs for audiences, saying he’d been trying to do it, too

No dates: 'When I was 13, I couldn't get any dates,' Terry admitted. 'I was alone in my room, Saturday night, and I was like, 'Man, another lonely night.' And all of a sudden, my pec moved. And I looked down and the other one did it… and it's so funny because I never stopped'

No dates: ‘When I was 13, I couldn’t get any dates,’ Terry admitted. ‘I was alone in my room, Saturday night, and I was like, ‘Man, another lonely night.’ And all of a sudden, my pec moved. And I looked down and the other one did it… and it’s so funny because I never stopped’