Tayyab Subhani, 30, and Mohammed Safdar, 42, deny charges of endangering a passenger aircraft.
The court heard some passengers had reported seeing the men, returning from Safdar's mother's funeral with his daughter and niece, behaving in a "rude and aggressive" manner before the flight took off.
When cabin crew made an announcement asking for a medical professional to assist an elderly passenger who had fallen ill, Safdar offered his services.
The crew established he had no medical credentials and turned him away, resulting in a confrontation, the court heard.
Safdar, encouraged by Subhani, then made threats to kill crew and passengers, resulting in "fear and panic", Mr O'Neill said.
The alleged threats, made in Urdu, included the words: "No more crew, no more passengers, finish everything."
Safdar is also alleged to have made stabbing hand gestures.
The pilot, who described the incident as the most serious of his career, contacted UK air traffic control and was instructed to begin emergency procedures.
Chelmsford Crown Court jurors heard neither was a "terrorist nor a political or religious extremist".
Prosecutor Brian O'Neill QC said that although neither man was capable of carrying out the threats, the claim had been made deliberately and the pilot had no option but to take it seriously.
He said the day Pakistan airlines flights PK709 took off from Lahore heading for Manchester. It never arrived at its intended destination.
As a result of the behaviour of these two defendants, especially Mr Safdar, the flight had to be diverted to Stansted and was escorted by two RAF Typhoon fighter jets.
This behaviour involved threats to kill members of the cabin crew, threats to kill passengers and threats to blow up the plane whilst it was in flight.
Such utterances, if made at ground level, may sometimes be capable of being ignored or not being taken seriously but when those threats are made in flight at 30,000 feet on a commercial jet, that's not an option."
Fighter jets were scrambled to intercept a commercial aircraft after two passengers threatened to blow the plane up at 30,000 feet, a court has heard.
Tayyab Subhani, 30, and Mohammed Safdar, 42, were arrested on May 24 after the Boeing 777 they were travelling on was forced to make an emergency landing at Stansted Airport in Essex.
Once on the ground, the aircraft was surrounded by armed police and a full-scale bomb alert was called. The men were arrested and hundreds of passengers were forced to remain on board until investigators established there was no danger.
The men, who are from Lancashire, deny endangering the safety of an aircraft.