The people of Catalonia in north-eastern Spain are voting in a disputed and non-binding poll on independence.
The Spanish judiciary has ruled the vote unconstitutional but Catalan leader Artur Mas warned against any attempt to disrupt it.
Spain's constitutional court suspended earlier plans for a referendum on secession.
Prime Minister Mariano Rajoy said the vote would have no effect and urged the region to return to "sanity".
Voters will be asked whether they want a Catalan state and whether that state should be independent.
More than 40,000 volunteers are helping to set up and run the informal exercise.
Two hours before the close of polling, 1,977,531 had voted, according to the Catalan government, the BBC reports.
Catalonia is a wealthy region of 7.5 million people and contributes more to the Spanish economy than it gets back through central government funds. Economic and cultural grievances have fuelled Catalan nationalism.
Pro-independence supporters have campaigned earnestly for a big turnout.
Catalonia adopted a charter in 2006 giving it "nation" status but this was overruled by the Constitutional Court in 2010.
Independence supporters hope that a strong vote of support will put more pressure on the central government to open negotiations over more tax and political autonomy, ultimately leading to a full-blown independence referendum. They say that support from more than 1.5 million Catalans would add weight to their cause.
Many of those opposed to independence are not expected to participate in the poll.