BANGKOK—Thai authorities imposed a curfew in parts of the country's troubled southern provinces Wednesday after at least 16 Islamist militants dressed as government troops were killed in a daring but botched middle-of-the-night attack on a Thai military base early Wednesday.

It was one of the most brazen assaults in the nine-year-old insurgency in the Muslim-dominated provinces of southern Thailand, and a significant setback for the guerrillas after stepping up their campaign in recent days and killing five soldiers in a...