Secretary of War Pete Hegseth signed a deal in Caracas on Wednesday. It will bring back military ties between the United States and Venezuela.

Caracas is the capital of Venezuela. His visit was not announced ahead of time.

The deal means the two militaries will work together again.

Hegseth said the deal covers joint training. He said the two sides will also share secret facts about threats.

He said the two militaries would fight drug smuggling together. The Associated Press reported his remarks.

He signed the deal at the palace of Venezuela's president. He signed it with the country's defense minister, its state news service said.

Hegseth met there with Venezuela's acting president.

“We spent some time talking about the long history of our countries, so in many ways we see this as a reestablishment of our defense partnership and the opportunity to work together between our two great militaries,” Hegseth said, according to The Associated Press.

Venezuela's leaders said the deal will help train their troops. They said it will also help them get new technology.

U.S. forces captured the man who was then the president of Venezuela in January.

President Donald Trump has said he will focus more on the Western Hemisphere. He has also said he will fight drug gangs in Latin America. The Associated Press reported both points.

The Western Hemisphere is the half of the world that includes North and South America.

The Associated Press published its report on the agreement.