BARCELONA, Spain (AP) — The battle between Spain and its Catalonia region has been brewing for years.

In recent weeks, it has come to a head, starting with an Oct. 1 referendum that the Spanish courts have declared illegal. Supporters of independence brought sleeping bags the night before, occupying polling stations to make sure it went ahead. On the day of the vote, police fired rubber bullets, smashed their way into polling stations and beat back protesters with batons. Hundreds were injured. The Barcelona soccer team played its game that day in an empty stadium because of safety concerns.

In the end, those who voted were overwhelmingly in favor of independence, but only about 2.3 million of the region's 5.3 million voters cast ballots. Critics say the vote didn't meet the basic criteria to be valid. Polls have shown the region about evenly split on independence.

Weeks later, it's still not clear whether the region's leader has actually declared independence. On Thursday, he threatened to do so explicitly unless talks are held. Now, Spain's central government is preparing to revoke the region's autonomy, meaning the uncertainty is far from over. People on both sides have been taking to the streets to make their views known.

Catalonia, one of Spain's 17 autonomous regions, has some 7.5 million people and includes Barcelona. The region has its own language and generates a fifth of Spain's 1.1 trillion euro economy.

Here, AP photographers chronicle a fraught month in the region and the nation.