According to a local official, the gunmen infiltrated a checkpoint guarding the Balhaf LNG terminal in the southern Shabwa province, killed one soldier and then entered a cargo container where four more troops were sleeping and shot them dead.
The attackers then fled in a vehicle, he said.
The assault follows an escalating campaign of drone strikes by the US over the past fortnight and warnings of militant attacks that prompted Washington to close embassies across the Middle East and evacuate some staff from Yemen.
A Yemeni government spokesman said last week that the $4.5 billion gas facility, jointly managed by Yemen LNG and France’s Total, was one of two energy targets that suspected al-Qaeda militants had been plotting to attack.
Washington stepped up drone strikes on suspected al-Qaeda targets in Yemen which killed at least 15 people in three days.
US ally Yemen, one of the poorest Arab countries, is the base for Al Qaeda in the Arabian Peninsula, one of the most active branches of the network founded by Osama bin Laden, and militants have launched attacks from there against the West.
The Balhaf facility, the largest industrial project ever undertaken in Yemen, opened in 2009. It is heavily guarded by Yemeni troops.
It supplies gas cooled to liquid for export by ship, under long-term contracts to GDF Suez, Total and Korea Gas.
A private security source working for oil and gas firms in Yemen told Reuters that Sunday’s killing appeared to be in retaliation for recent drone strikes that killed scores of Islamist insurgents in the south.
“The checkpoint they attacked is one of many leading up to the gas facilities,” said the source, who spoke on condition of anonymity.
“The militants know that it’s impossible to penetrate all of the checkpoints and that’s why they didn’t attempt to go further. They just wanted vengeance.”
He said there were usually up to 1800 Yemeni soldiers guarding oil and gas facilities in Shabwa and the number had been increased in recent weeks.
The Yemeni government said last week it had foiled a plot by al-Qaeda to seize the al-Dabbah oil export terminal in Hadramout and the Balhaf gas export facility. Plans for such an attack will have raised alarm bells in Washington.
In January, Islamist gunmen attacked an Algerian gas plant, seizing hundreds of hostages before the army stormed it four days later. Dozens of foreign workers were killed.
The security source said tight security arrangements are already in place in Yemen to protect oil and gas facilities and foreign experts working there from potential attacks by the Islamist militants.
Foreign workers rarely venture outside their heavily-fortified compounds and are usually flown out directly without having to drive through areas accessible by insurgents.