Passengers are demanding compensation after being stuck on the tarmac for hours.

Passengers were stuck on a hot plane with no food on Saturday, after their Qantas flight from Melbourne to Wellington was diverted.

The Boeing 737, flight QF171, was due to land in Wellington around 2.35pm on Saturday, before its landing was aborted and it was sent to an air force base in Ōhakea, near Palmerston North.

Were you on the plane? Email photos and video to newstips@stuff.co.nz

WARWICK SMITH/STUFF The Qantas plane on the tarmac at Ohakea RNZAF Base.

Passengers weren't let off the plane until 7pm. Customs officials from Wellington and Napier arrived at about 7.30pm to process them through a makeshift immigration.

READ MORE:

* Six hours in a stinking plane: Canadian airline investigated after 'deplorable' flight delays

* Stranded Singapore Airlines flight leaves Auckland Airport after seven-hour wait

Those on board complained the plane was too hot and they went without food after 11am New Zealand time, when breakfast was served on the plane.

SUPPLIED/RYAN NEWINGTON Passengers said it was "boiling" hot on the plane.

A passenger told Stuff they departed on buses to Wellington at 8.40pm, and the journey was expected to take two hours.

Passenger Tracy Johnson said she felt ill by the time they disembarked and that fellow passengers were close to fainting.

She said she couldn't understand why passengers hadn't been allowed to wait in a room at the air base, rather than on the plane for hours.

TIM GORMAN Flight QF171 was diverted to Ohakea air base.

"An elderly lady hugged me when we got off, she thought she was going to faint ... we all did," she said.

"We need compensation."

A Qantas spokesperson said the flight was diverted from Wellington due to a mechanical issue, and then was unable to land in Palmerston North due to weather conditions.

"We apologise to our customers for the disruption but safety will always be our first priority."

Passenger Ryan Newington from Melbourne said the flight was full, and it was "extremely hot" on board.

Newington said some people were "visibly distressed" from the heat in the cabin. Young children and babies had been moved to the front of the plane, close to an open door.

"The cabin staff have been very kind and considerate which is helping, but lots of people [are] understandably frustrated."

After landing, passengers took to social media to complain.

#QF171 Can’t leave plane because no customs, can’t fly plane as broken, can’t get replacement plane (easily at least) as at air base. A difficult problem to solve @Qantas! @nzherald @NZStuff @radionz — Suzy McKinney (@suzyemckinney) November 16, 2019

"Awkward when your international flight gets diverted to an air base, and they can't let you off the plane because there's no customs," one passenger wrote on Twitter.

"Can't leave plane because no customs, can't fly plane as broken, can't get replacement plane (easily at least) as at air base. A difficult problem to solve @Qantas!"

#QF171 sitting on the tarmac in the sun, getting extremely hot in the plane. Many passengers visibly distressed. @Qantas won't open the door because reasons. Customs apparently driving up from Wellington (2 hours away), not sure theres much point, we'll all be roasted by then. — Ryan Newington [MVP] 🇦🇺 (@RyanLNewington) November 16, 2019

Another person on the flight said passengers were "sitting on the tarmac in the sun, getting extremely hot in the plane".