A Mastic Beach man who is the father of four girls was so overjoyed to learn that he was going to have a son that he fainted, and it was all caught on camera.

Julio Pena, 38, and his wife, Kari, 35, got the news at a gender reveal party on Jan. 17, ABC News reported.

The couple wanted the gender of their fifth child to remain a surprise, and so asked their doctor to place the gender of the baby in a sealed envelope, which they didn’t look at. They also gave the doctor permission to disclose the gender to their oldest daughter, Chastity, according to the report.

The video, which was posted to YouTube on Jan. 20, shows the couple standing before a cake coated in white icing, under which would be either blue or pink, indicating the gender of the baby.

Surrounded by friends and family, who are heard chanting “It’s a boy! It’s a boy!” in encouragement, the Penas sliced the cake to reveal its blue interior.

The partygoers can be heard screaming in excitement, and the soon-to-be father of five is seen shouting with his hands in the air before crumpling to the ground.

“It was like I collapsed and fainted at the same time,” Pena told ABC News in a Tuesday interview.

advertisement | advertise on newsday

“He was so nervous. He was dying for a boy forever,” Kari Pena said of her husband, who works at a transportation company.

Their son is due in June. In addition to Chastity, 16, the couple are also parents to daughters Christalyn, 13, Nayalyn, 8, and Nakayla, 7.

The video had more than 28,000 views on ABC’s “Eyewitness News” Facebook page.