BARCELONA, Spain — The trial of a former leader of Catalonia charged with civil disobedience for organizing an independence vote in 2014 began on Monday and was met with another act of defiance from the region’s secessionist movement.

When the former leader, Artur Mas, entered a Barcelona courtroom Monday morning, an estimated 40,000 separatists protested outside the building, according to the police. Mr. Mas is on trial for holding the vote even though it was declared illegal by the Spanish courts.

The case comes as the secessionist drive in Catalonia enters another critical phase, with the separatist government pledging to hold a binding independence referendum in September, over the strenuous objections of the government in Madrid.

Mr. Mas is standing trial with two other politicians who helped organize the vote in 2014, in which those who cast their ballot opted overwhelmingly for independence, although less than half of the population took part. The prosecution is seeking to bar the three defendants from holding public office for 10 years. Mr. Mas faces two separate charges, of disobedience and breach of trust.