DETROIT—The city of Detroit filed for federal bankruptcy protection Thursday after decades of decline, a new low for a city that once defined industrial America's might but was hollowed out by the flight of residents and businesses to the suburbs.

The filing by the automobile capital and onetime music powerhouse—which has liabilities of more than $18 billion—is the country's largest-ever municipal bankruptcy case.

The...