FREDERICTON -- Air Canada is apologizing to passengers who found themselves rerouted late at night to Fredericton with nothing to eat -- that is, until a WestJet pilot stepped in to buy them pizza.

The passengers were on a flight from Toronto to St. John's, N.L. on Feb. 8 when bad weather forced the plane to be rerouted to New Brunswick.

Passenger John Samms took to Twitter to say that an Air Canada employee announced it was impossible to get food at that hour.

Samms then tweeted: "Awkward but funny moment: @westjet guy walks in and says 'hey guys I'm from Westjet and we do things differently, want some pizza?"'

In an interview Wednesday, Samms said it was awkward because the Air Canada employee was still standing there.

"After the Air Canada guy had said there's absolutely nothing that we can do here, and then the WestJet guy shows up as a hero, you had to wonder if there was some kind of confrontation going to happen," he said.

"But no, that didn't happen and everybody was appreciative and applauded the WestJet employee."

Samms said four or five pizzas were ordered.

He said that the Air Canada employee then offered $10 vouchers, but there was nowhere to use them.

The pilot could not be reached for comment, and WestJet declined to speak.

In a statement, Air Canada said it was sorry their customers experienced a weather-related diversion to an airport that was not expecting them on such short notice.

"Unfortunately the food service was closed but thankfully, a caring customer, an airline employee himself, so truly empathetic to the situation, stepped up and helped out. We have spoken to him, thanking him and are truly grateful for his generous spirit," the statement read.

"Clearly we should have done better for our customers and have been in touch with them to apologize."

Samms posted pictures on social media, calling the WestJet pilot a "legend."

"I've never been so pleased to see pizza," Samms wrote.

The flight departed Fredericton early the next morning for St. John's.

Samms said he has received an email from Air Canada, offering a 25 per cent discount on his next flight.

Still, Samms said he was impressed with the pilot and the social media comments of other WestJet employees, and will try to fly WestJet in the future, when possible.

"It looks like their employees really buy in and have a stake in the reputation of the place. I'm obviously partial to WestJet going forward," he said.