OKLAHOMA CITY (Reuters) - An Oklahoma bill that could send any doctor who performs an abortion to jail headed to the governor on Thursday, with opponents saying the measure is unconstitutional and promising a legal battle against the cash-strapped state if it is approved.

The bill that makes abortion a felony punishable by up to three years in prison was approved by the Republican-dominated Senate on Thursday. Governor Mary Fallin, a Republican opposed to abortion, has not indicated if she will sign it or not.

The bill also calls on state medical boards to revoke licenses for the "performance of an abortion" and allows an exemption for abortion necessary to preserve the life of the mother.

"This is our proper function, to protect life,” Republican Nathan Dahm, an author of the bill, said during a debate. Supporters have said the bill could withstand a legal challenge because the state was within its rights to set licensing requirement for doctors

Democratic Senator John Sparks said the bill would not stand up in court and lead to expensive legal battles.

"This measure is harmful, discriminatory, clearly unconstitutional, and insulting to Oklahoma women and their families," the Center for Reproductive Rights, an abortion rights group, said in a letter to Fallin.

Several abortion rights groups have promised to a court fight if Fallin signs it into law.

(Reporting by Heide Brandes; Writing by Jon Herskovitz; Editing by Chizu Nomiyama and Marguerita Choy)