MADRID/HAVANA (Reuters) - Spanish premier Pedro Sanchez agreed with Cuban President Miguel Diaz-Canel to deepen bilateral political ties on Thursday, at the start of the first official visit by a Spanish leader to the Communist-run country in three decades.

The two leaders signed an agreement instituting annual high-level political dialogue meetings between Spain and Cuba, touching on an array of topics including human rights.

Relations between Cuba and the European Union have steadily improved since being formally relaunched in 2016 after a two-decade chill, even as they have festered between the island and the United States.

Even before he touched down in Havana, Sanchez had come under fire from some opposition activists, however.

Sanchez was in Cuba “to entertain dictators instead of calling for freedom and democracy,” the leader of the opposition Popular Party, Pablo Casado, wrote on Twitter.

However, Sanchez will hold talks with representatives of some of Cuba’s intellectual dissidents, including the directors of an independent digital magazine and a think tank, as well as proponents of the fledgling private sector, according to a Spanish government official.

A succession of world leaders has paraded through the Caribbean’s largest island nation in recent years as it has sought to improve relations with the West, modernize its centrally planned economy and attract more foreign investment.

But this is the first official visit by a Spanish Prime Minister since that of Sanchez’s fellow social democrat Felipe Gonzalez in 1986. Spain is Cuba’s third largest trading partner and maintains strong cultural ties with its former colony.

Sanchez and Diaz-Canel, who succeeded Raul Castro as president in April, also agreed to increase cultural cooperation on Thursday, after holding talks in Havana’s Revolution Palace.

“The new generation of Cuban leaders needs this rapprochement that shows Cuba’s foreign relations do not need to be limited to the U.S.-Cuba conflict or alliances with countries like Russia and China,” said retired Cuban diplomat Carlos Alzugaray.

“It is oxygen at a difficult moment,” he said.

Sanchez, who is traveling with executives from two dozen companies, will on Friday morning inaugurate a Spanish-Cuban business forum in a hotel that the administration of U.S. President Donald Trump recently added to a list of places banned to U.S. travelers.

Spanish-Cuban annual bilateral commerce is already around $1.3 billion, according to Cuban data. The tourism sector is dominated by alliances between Spanish hotel chains and Cuban companies.

“Cuba is opening up and we are interested in our companies being well positioned to have access to the most important contracts,” a Spanish government official said.

Although Cuba is seeking to drum up more investment and credit lines, it is behind on payment to providers from Spain and elsewhere. Diaz-Canel assured Sanchez on Thursday that Cuba would make good on those debts.

Former U.S. President Barack Obama, who sought to normalize relations between the former Cold War foes, visited Havana in 2016. However, Trump has rowed back on the detente, tightening the decades-old U.S. trade embargo.