The U.S. and Cuban governments avoid talking politics or religion, but as with every strained relationship, the weather is usually a safe topic.

For decades, the two countries have quietly worked together to track tropical storms and hurricanes in hopes of saving their citizens' lives.

The two sides share meteorological data on storms. Cuban forecasters have received training in the U.S. And earlier this week, eight U.S. Air Force C-130 planes crossed into Cuban airspace to gather information on Tropical Storm Ernesto's wind speed, center and other information.

Check the National Hurricane Center's forecast to monitor Tropical Storm Ernesto

In an unusual public acknowledgment Tuesday, the National Hurricane Center commended Fidel Castro's communist government for its assistance.

"Special thanks to the government of Cuba for permitting the recon aircraft (to) fly right up to their coastline to gather this critical weather data," forecaster Stacy Stewart wrote in an advisory.

Cuba has long pumped money into meteorological research. In 1900, Cuban meteorologists tried to warn U.S. weather officials of the danger of a hurricane that was moving into the Gulf of Mexico. Their predictions were dismissed by Americans and the storm killed at least 8,000 people in Galveston, Texas, according to Erik Larson, author of "Isaac's Storm: A Man, a Time, and the Deadliest Hurricane in History."

Castro took power in 1959, and contacts between Cuba and the U.S. are sharply restricted. But the two countries have worked together to track storms for the past 30 years, said Lixion Avila, a forecaster at the U.S. hurricane center and a native of Cuba. Cuban weather specialists even attend the Florida center's training sessions, he said.

People say, "'Oh, you talk to Cuba,'" Avila said. "It surprises me that people are more interested in the gossip and politics rather than the number of people we are saving in the U.S. and Cuba by working together."

Jose Rubiera, head of Cuba's Meteorological Institute, told reporters in Havana in May that the cooperation "is not only desirable, it is necessary to save human lives."

Still, the issue of airspace has been tricky. The National Oceanic and Atmospheric Administration, which oversees the hurricane center, has long been allowed to fly its WP-3D Orion planes over Cuban airspace, but it has only two of them, limiting the amount of time it can fly during a storm.

The U.S. State Department, on the other hand, was skittish about flying near the Cuban coast following several confrontations between the two countries, including the 1996 killing of four members of the Cuban-exile group Brothers to the Rescue. The Cuban military shot their planes down, alleging the pilots violated national air space.

Although Cuba agreed to let U.S. weather planes fly, it was not until National Hurricane Center Director Max Mayfield pressed the State Department to change its policy that it relented three years ago and agreed to lend Air Force planes to the cause.

"Max was pushing the issue, and the Air Force squadron's chief navigator went up to D.C. and explained why this was so important," said John Pavone, who overseas aircraft reconnaissance for the center.

Today, whenever the center wants to track a hurricane over Cuban airspace, it submits a formal request to the State Department, which in turn passes the request to Cuban officials.

Check the National Hurricane Center's forecast to monitor Tropical Storm Ernesto

The cooperation has its limits. As Ernesto approached, U.S. officials received permission to fly over Cuban airspace for 72 hours, but by Wednesday they were told that the storm had passed the island and that they were no longer welcome.

Cooperation between the U.S. and Cuba on weather-related issues gives hope to some experts that the two countries may eventually work more closely on other issues, such as immigration and the fight against drug smuggling, where they now have limited communication.

"The lesson is that the United States and Cuba, despite their history of confrontation, have a lesser-known but important history of negotiation," said Damian Fernandez, director of the Cuban Research Institute at Florida International University in Miami. "When there are mutual interests, these two sides do hammer negotiations out."

Click here to check out FOXNews.com's Natural Disaster Center.