A man has been shot dead after trying to enter the cockpit of a flight from Bangladesh to the United Arab Emirates, waving a gun and threatening to blow up the plane, airline and aviation authority officials say.

The man's threat to blow up the plane, which was on its way to Dubai from Dhaka via Chittagong in south-eastern Bangladesh, led its pilots to make an emergency landing at Chittagong's Shah Amanat International Airport.

Key points: With the plane close to Chittagong after leaving Dhaka, the passenger stood up from his seat and tried to go to the cockpit

With the plane close to Chittagong after leaving Dhaka, the passenger stood up from his seat and tried to go to the cockpit When a member of the crew blocked his way, he showed a toy pistol and threatened to blow up the plane

When a member of the crew blocked his way, he showed a toy pistol and threatened to blow up the plane Other members of the crew alerted the pilots to the problem and they asked air traffic control for an emergency landing

The suspect, who said he had a personal issue with his wife and told the pilot he wanted to speak to Bangladesh's Prime Minister Sheikh Hasina, died after military commandos subsequently stormed the plane.

"We tried to arrest him or get him to surrender but he refused and then we shot him," said Major General SM Motiur Rahman.

Before the commandos moved in, all 142 passengers and most of the crew had been let off the aircraft unharmed.

One crew member had been held hostage, officials said.

Suspect had a toy pistol, and claimed to have explosives

Air Vice Marshal Nayeem Hasan, chairman of the Civil Aviation Authority of Bangladesh, told reporters at a news conference that as well as holding what appeared to be a pistol, the passenger claimed he had explosives bound to his body.

With the plane close to Chittagong after leaving Dhaka, the passenger stood up from his seat and tried to go to the cockpit, according to aviation officials.

When a member of the crew blocked his way, he showed his pistol.

Loading

He then said he had explosives and if they did not open the door of the cockpit he would blow up the plane, officials said.

Other members of the crew alerted the pilots to the problem and they asked air traffic control for an emergency landing.

Police later said the man's pistol was a toy, and he carried no explosives.

"The pistol with the suspect was a toy pistol and he had no bomb attached to his body," said Kusum Dewan, additional commissioner of Chittagong police.

It was not immediately clear if the man had explosives, although authorities thought the pistol was real, according to a senior aviation official.

Officials said the investigation is focusing on his background and identity, and how he was able to board with the toy pistol.

Air Vice Marshal Hassan said the suspect appeared to be "mentally imbalanced".

Military commandos stormed the plane and shot the suspect after he refused to surrender. ( Reuters: Stringer )

"I am saying this because of his behaviour. He wanted to talk to the Prime Minister," he said.

There were reports the suspect also said he had a personal issue with his wife.

Before the suspect was pronounced dead, authorities had described him as a "terrorist" and said he had been arrested and was being questioned.

Bangladeshi soldiers could be seen in the live TV broadcast taking positions inside Shah Amanat International Airport in Chittagong, 252 kilometres south-east of Dhaka.

AP/Reuters