Pakistan television footage shows the aftermath of a bomb attack which killed at least 11 female students
Hours later, gunmen stormed part of the hospital where the wounded were being treated, leaving at least 10 dead.
A senior city official was killed in the exchange. Security forces are surrounding the building,
Quetta is the capital of Balochistan province, which has seen a surge in militant violence in recent months.
Some attacks are carried out by separatists and others by Islamists who oppose women's education.
The latest violence began when a bomb exploded on a bus carrying female students at a university .
Image may be NSFW.
Clik here to view.
Clik here to view.

"It was an improvised explosive device placed in the women university bus," police chief Zubair Mahmood said.
Later explosions rocked the medical centre where the students were being treated,
Militants armed with grenades were positioned there and exchanged fire with members of the security forces who rushed to the scene.
"They [the militants] are several in number, we are still facing resistance from them, and people are stranded inside the hospital. We are trying our best to rescue the people," said Jan Mohammed Bulaidi, spokesman for Balochistan's chief minister, Reuters reports.
Pakistani TV says a senior Quetta official, Abdul Mansoor Khan, who had gone to the hospital to visit the wounded students, was killed in the stand-off. There are fears of more casualties.
No group has said it carried out either attack.
The violence came hours after militants carried out a rocket attack against a historic home in the Ziarat area of Balochistan, which was used by Pakistan's founding father Muhammad Ali Jinnah.
The house is said to have been severely damaged.
Last month the Taliban killed at least 11 people in an attack on security forces in Quetta.
\bbc.com