Tropical storm Emily brought drenching rain Thursday to parts of Haiti and the Dominican Republic, forcing evacuations, cancellation of flights and closure of government offices, but it then weakened in the mountains dividing the two countries, the US National Hurricane Center said. Wind speeds dropped to around 40 mph (65 kph) and the storm appeared to be breaking up, forecasters said, and it could be downgraded to a tropical wave in the day. The system still brought large amounts of rain that caused flooding that damaged hundreds of homes in Haiti. The hurricane center warned that the threat of flooding and mudslides remained as the system headed toward Cuba and the Bahamas. The government ordered the evacuation of more than 5,000 people in the Dominican Republic because of the potential for flooding from heavy rain. The country closed its courts, congress and many other government offices. Aviation officials said more than a score of flights to and from the two countries were canceled. Emily dropped more than 5 inches (140 millimeters) around the southwestern Dominican city of Barahona and an equal amount was still expected in the area, said Miguel Campusano, a forecaster with the Dominican meteorology office.