MADRID—A day after a majority of Scots voted against secession from the U.K., the parliament in the wealthy, industrial Spanish region of Catalonia approved a law to allow for its own, albeit nonbinding, referendum on independence.

The 106-28 vote Friday set Spain on a path toward a legal and political crisis. The central government in Madrid has vowed to block the referendum, which it says is unconstitutional.

After the law is published in the coming days, Catalonia's regional president, Artur Mas, is expected to sign a decree formally convoking the referendum for Nov. 9. At the Spanish government's request, the Constitutional Court is then expected to issue an injunction to halt the vote.

Mr. Mas has expressed misgivings about going ahead with the referendum in violation of Spanish law because the vote might lack international credibility. Another way for him to satisfy pro-independence groups clamoring to cast ballots would be by calling early regional elections as a proxy vote.

During the Catalan parliament's 2½-hour debate, many speakers took note of the historic nature of the proceedings.