The Spanish government has taken over control of an area called Catalonia and fired the area's local leaders.
The decision came after the Catalan parliament voted to declare independence from Spain on Friday, saying that wanted to be a separate country.
Demonstrations for and against independence went on into the night.
More are expected on Saturday, with a rally "for the unity of Spain and the constitution" to be held in the capital city, Madrid.
On the 1st of October 2017 an unofficial vote took place in Catalonia over whether or not the region should break away from Spain and become an independent country.
The region currently has some powers to make decisions about how it is run, but it is still part of the country of Spain. This is called being an autonomous region of Spain.
This referendum vote was organised and supported by the region's government, of which Carles Puigdemont is in charge.
2.2 million people were reported to have voted out of the 5.3 million people who could have voted. According to the Catalan authorities, just under 90% of those who voted backed independence.
However, the national Spanish government said the vote over whether or not it should become fully independent was illegal and it sent police to try to prevent it from happening.
There were lots of protests after people disagreed with the violent way that the police tried to stop what was happening.
After the vote had happened, at one rally 350,000 people gathered in Barcelona - the capital of Catalonia - to protest against independence from Spain. They waved Spanish and Catalan flags and carried banners saying "Together we are stronger" and "Catalonia is Spain".
Although reports say most people in the region didn't actually vote, the result backed independence.
Following the vote, the leader of the Catalan region - Carles Puigdemont - said he does want Catalonia to be independent, but that he would put off making any big announcements until he could have talks with the government of Spain, to see if they could resolve the situation.
Following this, Spain's Prime Minister Mariano Rajoy said he would trigger Article 155 of the Spanish constitution. Doing this would allow the Spanish government based in the city of Madrid to take over from the leaders in Catalonia without their permission.
But before the Spanish Government could do this, the Catalonian parliament held a vote and declared independence.
To understand what is happening now in Catalonia, it is important to understand a bit about the history of the area.
Catalonia is a wealthy region in the north-east of Spain, with a population of about 7.5 million people. That's almost as many as the number of people who live in country of Switzerland.
Catalonia has its own language and culture, and Barcelona - a popular city for tourists to visit - is its capital city.
The region has a history which dates back almost 1,000 years.
Before the Spanish Civil War (1936-1939), Catalonia was able to make some decisions about how it was run. This is called being autonomous.
But when the dictator General Francisco Franco ruled Spain from 1939 to 1975, it lost this autonomy.
After Franco's death, how Spain is run was reorganised and the area was given its autonomy again.
Some people think that Catalonia still doesn't have enough freedom and power from the Spanish government and that it should be allowed to run itself completely.
They believe people who live there should get to vote on this issue - a bit like when Scotland voted over whether or not it wanted to be part of the UK.
Pressure has grown over the last five years for the Spanish government to allow this vote to happen, but the Spanish prime minister has refused, saying it goes against the constitution of Spain, which talks about the "unity" of the country.
There are also many people who do not agree with the idea of Catalonia becoming independent.
They say it already has lots of freedom to run itself, along with other areas of Spain, like the Basque country and Galicia.
In 2015, politicians who support independence won the regional election. They said they would work on ensuring an official referendum happened that Spain would have to act on.
After the national Spanish courts banned the vote and the government sent national police and the Guardia Civil (military staff who do police duties) to the area to prevent it from happening, there was a lot of violence between those who wanted to vote and the authorities trying to stop it.
They arrested Catalan officials, blocked people from voting, took ballot papers and seized ballot boxes from polling stations, which had been set up for people to vote.
This led to fighting between the people voting and the police. Many people in Spain, and all over the world, were shocked by how violent things became, as it was really unexpected.
TV reports showed people being kicked and aggressively dragged away from polling stations. Some police officers were seen firing rubber bullets, hitting people with batons and pulling women by their hair.
More than 900 people were hurt, including 33 police officers.
The violent methods used to stop people from voting made a lot of people very angry.
The national Spanish government's representative in Catalonia apologised to those who were injured.
Since the vote on 1 October, there have been protests by people on both sides of the argument about what has happened.
A little more than a week after the vote happened, Carles Puigdemont signed a declaration of independence but he paused it taking effect so he could talk to the Spanish government to try to sort out the situation.
But the Spanish government said it would trigger Article 155 of the constitution. Article 155 gives permission for the Spanish government to take over from the Catalan government.
In response, the Catalonian Parliament held a vote and declared independence.
Thousands celebrated the declaration of independence on the streets of Barcelona, Catalonia's capital.
There were also demonstrations with protesters in Barcelona waving Spanish flags and saying that they wanted to stay part of Spain.
On 27 October, the Spanish government stripped Catalonia of its special powers and took charge of its government.
They fired Catalan leaders and also took control of Catalonia's police.
The Spanish Prime Minister, Mariano Rajoy called for regional elections in December in the hope of ending the crisis..
On 21 December the independence parties won a narrow majority in a Catalan election. Independence still remains a possibility.