Prosecutor Alex Warren said Sarwar had been a difficult passenger even before the turbulence hit, having twice refused to put on his seatbelt during takeoff. He also said Sarwar had thrown food around the cabin.
But the real trouble began as the aircraft ran into turbulence.
"There was terrible turbulence during the flight and some passengers were very frightened," Mr Warren said.
"The defendant started chanting Allahu Akbar over and over again and very loudly. People were getting very distressed with his behaviour.
"When the plane finally landed, he shouted 'boom'.
"It left some passengers in tears while one man angrily confronted the defendant before being told to sit down by cabin staff.
"Police were then called and the defendant was arrested."
One passenger angrily confronted Sarwar at the end of the flight, the court heard.
But Sarwar's lawyer Balbir Singh said his client had been upset after attending his grandmother's funeral in Pakistan and was "scared" by the turbulence.
"Mr Sarwar was scared during the flight," he said.
"He prayed, chanting Allahu Akbar, which translates as God is Great. When the plane landed he did shout out 'boom'.
"It was a very foolish thing to do and he can't really explain why he said it. It was the height of foolishness.
"He is very sorry for his actions and realises what distress this caused to other passengers."
Judge Francis Laird QC said Sarwar's behaviour had a "frightening effect on some of the passengers and reduced some to tears".
"You misbehaved and you were arrogant on-board," he told the defendant before handing down a 10-week jail sentence.