Two EMTs tied the knot Monday right after an FDNY ceremony to honor a member who took his own life — adding a silver lining to an otherwise somber day.

The surprise nuptials caught dozens of emergency personnel off guard at Battalion 18 headquarters in the Bronx following a traditional bunting ceremony to honor Bronx EMT rookie John Mondello, who took his own life last week.

“It totally changed the mood,” Anthony Almojera, vice president of Local 3621 of the FDNY EMS officers’ union, told The Post. “Everybody was sad, trying to be there for each other. All of a sudden these two people decided, ‘Hey, let’s do this.’ ”

“In the midst of all that sorrow it was really nice to have this uplifting, inspiring moment of two people who want to spend the rest of their lives together,” he said. “They brought joy to all their co-workers. It was something I think the station needed.”

The couple — Dolores Saez, who serves on the Bronx Tactical Response Group with Mondello, and Melvin Aviles, a member of EMS Station 18 — announced the news after the ceremony, with the FDNY bagpipes still on hand and a department chaplain conducting the ceremony.

Photos of the event show the couple standing in the stationhouse in front of dozens of FDNY personnel — some snapping cellphone pictures — with pipes and drums members looking on.

The newlyweds could not be reached for comment.