Cabral, at the request of the Duke of Saldanha and Rodrigues Sampaio, then, respectively, President of the Ministry and Minister of Foreign Affairs, was appointed to direct the legation of Portugal to the Holy See, arriving in Rome in July 1870, even before the Portuguese takeover.
As the Italian troops attacked the walls of Rome in September, the diplomatic corps accredited to the Vatican was placed in a delicate situation, forced to share the hardships and risks of the siege.
The risks grew with the entry into Rome of hundreds of men who had been exiled by the pontifical government for their liberal ideas, creating a favorable situation for a popular uprising that any pretext would cause to explode.
The effectiveness of his action was such that the French chargé d'affaires translated, in these words, the recognition that the Portuguese diplomat inspired in him: Monsieur le Comte, vous nous avez sauvés.
But despite the services provided to the Vatican, the curia, after the danger had passed, maintained relations with Costa Cabral marked by some reserve, since the Portuguese diplomat, a supporter of liberalism and modern ideas, did not agree with the intransigence and reactionary attitude of Pius IX.
At the end of 1877, with the death of Pius IX predicted, Costa Cabral was elevated to the rank of ambassador, so that, with the representatives of the other three former Catholic nations, France, Austria-Hungary and Spain, he could eventually exercise the right of veto.
There he fell seriously ill, leaving for Portugal in early September, aboard the corvette Estefânia, then under the command of his son Fernando Augusto da Costa Cabral.