A driver deliberately crashed a bus full of passengers into a reservoir in southwestern China, hours after discovering his house had been demolished, local police said Monday.

Twenty-one people died and 15 were injured on July 7 when the bus swerved across five lanes, smashed through a guard rail and partially sank, according to police in the city of Anshun, in Guizhou province.

There were 12 students on the bus at the time of the crash, five of whom died, according to state media. Some of the students were about to sit their their college entrance exams, known as the gaokao, China Central Television (CCTV) reported.

The driver, surnamed Zhang, was among those killed.

"Zhang was unsatisfied with his life and with the demolition of his rented public house. In order to get noticed, he committed an extreme criminal act," the Anshun police statement said.

According to police, Zhang normally began his shift at noon, but on July 7 he asked another driver if he could start earlier.

Just after 9 a.m., he bought a bottle of baijiu, a strong Chinese alcohol, before pouring it into a plastic beverage container.

Hours later, just before the crash, Zhang sent his girlfriend a voice message on popular messaging app WeChat, expressing "world-weary" feelings, according to the police.

Shortly before he drove the bus into the reservoir, Zhang was seen drinking from a plastic beverage bottle in the driver's seat. At least 200ml of baijiu was found by police near the crash site.

State-run media China Daily said that Zhang had been given the rental property when he worked at a diesel engine factory in Anshun's Xixiu district. According to police, he hadn't lived there for some time.

Zhang had known the house was marked for demolition as part of a "shantytown reconstruction project," according to China Daily. He had applied for compensation and new housing, but while he was offered $10,360 for losing the house, he didn't claim it and was turned down for new accommodation, state media said.

On the day of the crash, Zhang found out that the house had been demolished, leaving him homeless.

Forced demolitions of housing to provide space for new development is a common occurrence in China, especially for people living in less developed, or more rural areas. The developments sometimes leave the old residents homeless and unable to pay for expensive new housing, without the safety net previously provided by the Communist State.