On his return to Havana, Mazariegos showed the value of a military governor for the protection of a city. For six weeks that summer a French squadron of four vessels lay off Havana, without venturing to attack the place, knowing that Mazariegos had mobilized and trained for fighting every able-bodied man in the place, and even some robust and athletic negro women. But the governor was not satisfied with defence alone. He contrived to get word to some Spanish captains at Nombre de Dios, who were going to convoy treasure ships to Spain, with the result that they presently came up unannounced and captured the whole French squadron. Again and again thereafter Havana was menaced, even attacked, but invariably Mazariegos repulsed the enemy, generally with heavy loss to the latter.

He felt, however, the need of better equipment, particularly of more cannon, and asked the crown to provide it. The crown declined or at any rate failed to do so, whereupon he set about doing it himself, and succeeded in getting, sometimes by rather strenuous means, a number of cannon and a good supply of powder. But a better fort than the ruins of La Fuerza was also needed, and to that enterprise he turned his attention with zeal. At the beginning of his administration Geronimo Bustamente de Herrera was commissioned by the crown to build a new fort, but after making plans and engaging workmen he fell ill and had to abandon the job. At the beginning of 1558, just as Mazariegos returned thither from Santiago, Herrera was replaced by Bartolome Sanchez, a competent engineer; who prepared new plans for the rebuilding of La Fuerza as it stands to this day. The Viceroy of Mexico, who was much interested in the safety of Mexican treasure ships which might put in at Havana, contributed 12,000 pesos in gold for the beginning of the work. There was much trouble in getting laborers for the work, in Spain. Sanchez wanted at least a hundred negro slaves. The government thought the number excessive, and gave him authorization for only thirty; whereupon he declared that the enterprise might as well be given up. In fact he secured in Spain only fifteen workmen, and with them he sailed for Cuba, hoping to secure the rest there, or elsewhere in the West Indies.

The work began early in December, 1558. A stone quarry was opened near Guanabacoa, and a kiln for making lime was built. But labor was still lacking. Sanchez wanted two hundred, negro slaves or others, and appealed to the people of the town to help him get them. In response they procured for him thirty slaves—their own, whom they were willing to turn over to him "for a consideration." Then the governor took a hand in the game. There were forty slaves at Santiago, who had been brought thither without the proper shipping papers, and were being held for that reason. Mazariegos sent to Santiago, confiscated them all, and brought them up to Havana, to work on the new fort. Some French prisoners who had been taken in a fight off Matanzas were also set at work on it. All tramps and vagabonds who were arrested were sent to La Fuerza or to the quarry, and for a time, until the crown stopped it, one third of the Indian village of Guanabacoa were kept at work on the fort.

Although Sanchez was in charge of the work and was responsible for it, Mazariegos spent much of his time there, watching it, directing it, and chastising with tongue and sometimes even with rod all who seemed laggards at the job. In time he succeeded Sanchez in authority. For Sanchez incurred much enmity on the part of some influential citizens, whose houses he took in order to make an open place about the fort. They accused him of corruption, of making gross errors in the plans for the fort, of fomenting discord, and of wasting money. He was too busy with building the fort to pay much attention to these things, even when they took the form of letters to the King. The outcome of it was that in the summer of 1560 Sanchez was removed from his place, and Mazariegos was put in charge of the completion of La Fuerza. A few months later Sanchez reached Seville, and pleaded his case to so good effect that the crown was convinced that injustice had been done him, and that he should not have been discharged. However, it was not practicable to reinstate him, though he was sent back a few years later to make an official inspection of the completed fort.

In addition to La Fuerza, Mazariegos built the first forerunner of the Morro Castle. In 1563 he built on the Morro headland a tower of masonry more than thirty feet high. It was intended primarily as a landmark, and was therefore painted white in order to make it visible at the greatest possible distance. But a watchman was generally kept in it, to espy approaching vessels and to signal to the city news of their approach. The tower is said to have cost only 200 pesos, and was paid for by the city of Havana.

Mazariegos presently became involved in affairs outside of Cuba. Many men deserted at Havana from the vessels of Angelo de Villafane, governor of Florida. Villafane complained and wanted Mazariegos to capture and return them. Mazariegos replied that he could not do it; to which we may doubtless add that he would not have done so if he could. He was desirous of increasing the population of Cuba, even in that way. When Villafane attempted to plant a Spanish colony at what is now Port Royal, South Carolina, and failed, Mazariegos had some correspondence with the King, and probably acquiesced in the royal opinion, that it would be impracticable to establish a colony at that point. In 1563, however, the King learned that the French had been quite successful in planting a colony on that very spot where the Spaniards under Villafane had failed, and he informed Mazariegos of the fact. The governor, acting upon his own initiative, but shrewdly guessing what would be acceptable to the King, sent Hernando de Rojas thither with a frigate and twenty-five soldiers, to see how much of a settlement the French had made, and to destroy it if he was able to do so with that force. In the summer of 1564 Rojas returned, reporting that the settlement had been abandoned by the French. He brought back with him one young Frenchman as a prisoner, and also a memorial stone which the French had set up to commemorate the founding of the place, bearing the date, 1561. Mazariegos commended Rojas for his work, sent the memorial stone to Seville, and then began planning to go in person or to send an expedition to search the Carolina and other coasts in quest of new French colonies. His theory was that the more French settlements there were, the more French vessels there would be, and therefore the more subject Cuba would be to alien annoyance.

This, however, was not to be. The end of Mazariegos's administration was already drawing near. He fell into some violent disputes with the citizens of Havana, over the appointment of alcaldes, a duty which they charged him with neglecting. He was also charged with packing the town council with his own creatures, with tampering with the mails so as to prevent people from writing to Spain any complaints of his maladministration, and of other misdemeanors. Bartolome Sanchez, who had returned from Spain and who had a bitter personal grudge against the governor for supplanting him as builder of the fort, petitioned the King to have a judge sent from Hispaniola to investigate him, but the King refused. Mazariegos, learning this, and feeling unwarrantably secure in royal favor, adopted a more arrogant attitude toward his opponents and critics, which did him no good.

In the spring of 1565, Garcia Osorio de Sandoval was appointed to succeed him as governor. Mazariegos thereupon wrote to the King, asking that there be no unnecessary law suits brought against him, as he was old, and ill, and poor. (He was not yet fifty years of age!) The King granted his request, and in consequence instructed Osorio to make his investigation as little annoying as possible. Osorio obeyed, and although the report of the inquest filled three big volumes, Mazariegos was not brought to trial on any charges and had no fines assessed against him. He remained living at Havana for some time, and then completed his career in the King's service as governor of Caracas, Venezuela. His administration had been a stormy one, but on the whole advantageous to Cuba, and had confirmed the Seville government in its policy of appointing others than mere lawyers to the insular governorship.

Garcia Osorio de Sandoval became governor of Cuba on September 12, 1565. As he was not a lawyer, the precedent which had been set in Mazariegos's case was followed in his, of appointing a lieutenant governor who was a lawyer to serve with him. His lieutenant was Luis Cabrera, who did not reach Cuba until later in the year, having suffered shipwreck and been obliged to put back to Spain and await the sailing of another vessel.

Osorio appears to have been a soldier, though probably retired from active service at the time of his appointment to the governorship. At any rate he made it his first care to improve the defences of the island. It is related that he bore with him from Spain to Havana a cargo of arms and munitions, including four brass cannon. These he placed upon the fortification, thus making a battery of eight pieces, and built a substantial platform of timber for them to stand upon. La Fuerza was not yet completed, but he took measures to expedite the work and hoped to have it finished in a year. In order to protect the place from possible raids by land, he closed and blocked all roads and trails leading into it from the west excepting the one along the beach. He organized a force of seventy men armed with arquebuses, to be quickly summoned in an emergency, and required them and all citizens to assemble for service whenever a strange sail was sighted. In addition, as a permanent contribution to defence, a spacious arsenal was built near the water front, to contain the stores of ammunition and to shelter the guards and citizens.