From the vantage post of Valencia the Cid carried his triumphant arms against the neighbouring kingdoms. He "warred against Denia and against Xativa, and abode there all the winter, doing great hurt, insomuch that there did not remain a wall standing from Orihuela to Xativa, for he laid everything waste, and all his booty and his prisoners he sold in Valencia." On one of these expeditions, however, he lost his capital for a while. Alfonso, in 1089, has received him back to favour, given him castles, and decreed that all the Cid's conquests should be his own property. In other words, he recognized the Cid as an almost independent prince. Almost immediately, however, the king became again suspicious of his powerful vassal, and seized the opportunity of the Cid's absence in the north to besiege his peculiar possession, the city of Valencia. When the Campeador heard this he was very wroth, and, by way of retaliation, carried fire and sword through Alfonso's districts of Najera and Calahorra, razed Logroño to the ground, and, in the words of the old Latin Gesta, "with terrible and impious despoilment he wasted and harried the land, and stripped it bare of its riches and seized them for himself." Alfonso hastily abandoned the siege of Valencia, and returned to defend his own country. But the Cid, having effected his purpose, came back another way, and found the gates of Valencia closed against him.

Then began that memorable siege of nine months, during which the people of Valencia suffered agonies of hunger and thirst, while the Cid maintained his remorseless leaguer round the walls. The besieged were reduced to the agonies of starvation, and those who rushed out, or were thrust forth as useless burdens by the townspeople, were massacred or sold into slavery by the Cid's soldiers. It is even said by the Moorish historians that the Cid had many of them burnt alive. The Chronicle pathetically records: "Now there was no food to be bought in the city, and the people were in the waves of death; and men were seen to drop and die in the streets." Thus wrote a poet of the devoted city:

"Valencia! Valencia! trouble is come upon thee, and thou art in the hour of death; and if peradventure thou shouldst escape, it will be a wonder to all that shall behold thee.

"But if ever God hath shown mercy to any place, let Him be pleased to show mercy unto thee; for thy name was joy, and all Moors delighted in thee and took their pleasure in thee.

"And if it should please God utterly to destroy thee now, it will be for thy great sins, and for the great presumption which thou hadst in thy pride.

"The four corner stones whereon thou art founded would meet together and lament for thee, if they could!

"Thy strong wall which is founded upon these four stones trembles, and is about to fall, and hath lost all its strength.

"Thy lofty and fair towers which were seen from far, and rejoiced the hearts of the people, ... little by little they are falling.

"Thy white battlements which glittered afar off, have lost their truth with which they shone like the sunbeams.

"Thy noble river Guadalaviar, with all the other waters with which thou hast been served so well, have left their channel, and now they run where they should not.