The plane took off from Don Mueang at 4.10 pm for Mae Sot with scheduled landing at 5.20 pm.
But as the plane arrived, and was about to descend after the landing gear was released, the pilot noticed that the plane was missing the runway and was on the direction of the building.
He managed to ascend the plane to avoid hitting the building, causing passengers on board to go panic.
He circled his plane for 15 minutes before making a safe landing amid the relief of all frightened passengers.
A villager near the airport said he saw the plane descending as if it was about to land though the runway is still over a hundred metres away.
But the plane ascended immediately until it disappeared into the heavy smog and later returned again and landed safely, he said.
He said the smog from farm burning a few days earlier had obstructed the visibility of the runway.