A bus carrying Pakistani soldiers slid off a mountainous road and fell into a deep ravine in the country's northwest on Saturday, killing 24 and injuring five others, officials said.

Senior government official Aqil Badshah said the bus was going from the garrison city of Rawalpindi to the northern town of Gilgit when the accident happened in the Kohistan district in the Khyber Pakhtunkhwa province.

He said the dead and injured were taken to a nearby hospital, and authorities were making arrangements to transport the bodies to Rawalpindi city near the capital Islamabad.

In a statement, the military said the dead and injured soldiers were originally from Gilgit, and were on leave traveling there from their base in the scenic valley of Swat.

Road accidents are common in Pakistan because of poor infrastructure and routine disregard of traffic laws.

On February 23, a bus carrying a wedding party plunged into a canal in the northwestern city of Peshawar, killing 17 people.

Most among the dead were women and children, and authorities at the time had said the driver's negligence caused the tragedy.