NAIROBI, Kenya — A dam burst in western Kenya, destroying villages and killing at least 44 people, officials said on Thursday, after weeks of heavy rains that had brought flooding and other damage across the region.

“The water has caused huge destruction of both life & property,” Lee Kinyanjui, governor of Nakuru County, where the disaster occurred, wrote on Twitter. “The extent of the damage is yet to be ascertained.”

He visited two villages “that were swept away,” he wrote later. The authorities were doing their best to evacuate families and to provide victims with medical attention, he added.

Forty people were reported missing, and about 500 families were displaced, government and aid officials said. Four people were hospitalized, and 42 others were treated for injuries, Fred Matiang’i, Kenya’s secretary for the interior, said at a news conference on Thursday.