Full council was asked to approve the closure of Sir Thomas Picton and Tasker Milward in Haverfordwest and create a new 11-16 school, with sixth forms moving to Pembrokeshire College.
But 31 out of 55 councillors went against the recommendation.
The decision has been welcomed by the 250 students and staff who protested ahead of the meeting at County Hall.
They want post-16 education to be provided in the new 11-16 school rather than at Pembrokeshire College.
A statement from the Haverfordwest Pupils Demand a Sixth Form group said: "Today the lions of Tasker Milward and Sir Thomas Picton roared, and the council finally listened."
"We proved that democracy still exists in Pembrokeshire. Our campaign that involved meetings, poster circulations and a Facebook page has received large support from the public of this amazing town, and we are so grateful to everyone who has ever supported us."
Haverfordwest Cllr Tom Tudor said the decision was a "brilliant victory" for the pupils of Sir Thomas Picton and Tasker Milward.
"Democracy has played its part. The council listened to the consultation results rather than ignoring them as they have in the past," he said.
Plans to shut two Pembrokeshire secondary schools have been scrapped following a U-turn by councillors.