MADRID — Spain rejected a United States request to extradite Hugo Carvajal, the former intelligence chief of Venezuela, because the request was politically motivated, a Spanish court said on Tuesday.

The court ruling also said the drug trafficking charges leveled against Mr. Carvajal were too “abstract,” and lacking sufficient detail.

At his extradition hearing in Madrid earlier this month, Mr. Carvajal’s lawyers argued that the United States wanted to extradite Mr. Carvajal for “a spurious purpose” — to make him stand trial for drug trafficking — while their main goal was to get information from him about President Nicolás Maduro of Venezuela.

The Trump administration has been trying to get Mr. Maduro to relinquish power after winning re-election in a vote that many believed was flawed. The United States, and several other Western governments, are instead supporting Juan Guaidó, the opposition leader, who swore himself in as the head of an interim government after calling the last presidential election fraudulent. But Mr. Maduro so far has resisted efforts to oust him.