?We will have immediate loss of civil liberties for five million Minnesotans,? Mrs. Bachmann, then a state senator, told a Christian television network as thousands gathered on the steps of the Capitol to rally for a same-sex marriage ban she proposed. ?In our public schools, whether they want to or not, they?ll be forced to start teaching that same-sex marriage is equal, that it is normal and that children should try it.?

Now that she is seeking the Republican presidential nomination, Mrs. Bachmann, a Minnesota congresswoman, is talking more about federal spending than about gay rights. But her political rise has its roots in her dogged pursuit of an amendment to the State Constitution prohibiting same-sex marriage ? ?her banner issue,? said Scott Dibble, a Democratic state senator who is gay ? and her mixing of politics with her evangelical faith.

The ?Bachmann marriage wars,? as Mr. Dibble calls that legislative debate, offer a case study in the congresswoman?s ability to seize an issue and use it to circumvent the party establishment ? the same tactic, analysts say, that made her a Tea Party star in Washington and a hot commodity on the campaign trail.

?That?s her recipe: find the issue, then use it politically to mobilize previously marginalized or disconnected groups,? said Lawrence Jacobs, a political scientist at the University of Minnesota. ?For those of us who followed her from the beginning, it?s like reading a romance novel with a formula.?

Mrs. Bachmann?s strong stance on homosexuality ? she once likened it to ?personal bondage, personal despair and personal enslavement? ? and her anti-abortion views have appeal for some Republican primary voters. In Iowa this month, she delighted conservatives by signing a pledge opposing ?any redefinition of marriage.? (Her fellow Minnesotan and presidential rival, Tim Pawlenty, a former governor, was left explaining why he did not.)

Yet her position has also become a distraction for her campaign, drawing critics and subjecting her family to the kind of scrutiny once reserved for the relatives of nominees. It has exposed a longstanding rift between the congresswoman and her stepsister, who is a lesbian. It has also raised questions about whether her husband, Marcus, who runs two Christian counseling centers, practices ?reparative therapy,? or gay-to-straight counseling, derided by critics as an effort to ?pray away the gay.?

For the Bachmanns, the issue is entwined with faith. Until recently, they were members of Salem Lutheran Church in Stillwater, part of the Wisconsin Evangelical Lutheran Synod, which holds that ?a believing member? cannot ?remain a practicing homosexual in defiance of God?s word.? Friends say they now attend services at another evangelical church, Eagle Brook, closer to their new home in another Stillwater neighborhood.

 ?They are absolutely not against the gays,? said one close friend, JoAnne Hood, who also attends Eagle Brook. ?They are just not for marriage.?

Same-sex marriage was not much of an issue here when Mrs. Bachmann, who declined to be interviewed, arrived at the Statehouse as a new senator in January 2001. Minnesota had already enacted its own version of the federal Defense of Marriage Act, which for legal purposes defines marriage as between a man and a woman.

Then, in November 2003, the Massachusetts Supreme Court declared that state?s law banning same-sex marriage unconstitutional. Mrs. Bachmann sprang into action.

?She was holding press conferences and saying, ?We can?t have that in Minnesota,? ? said Don Betzold, a Democrat and a former chairman of the State Senate Judiciary Committee. She vowed to introduce a constitutional amendment and, seemingly overnight, emerged as Public Enemy No. 1 to Minnesota?s gay rights advocates, who were alarmed by her word choice and her intensity.

?The threat she represented was very real,? said Mr. Dibble, who remembers Mrs. Bachmann ?trotting out junk science and debunked claims that being gay is a choice.? During visitor tours of the empty Senate chamber, he said, Mrs. Bachmann would bring people in ?to pray around my desk.?

When Out Front Minnesota, a gay rights group, conducted lobbying days at the Statehouse, Mrs. Bachmann made clear she was opposed to its agenda, which included legal recognition of domestic partnerships and nondiscrimination initiatives. Sometimes she would meet gay constituents with guests of her own, said Monica Meyer, the group?s executive director. ?She had ex-gay people,? Ms. Meyer said, ?who would tell her constituents that being gay was wrong and immoral.?

Inside the Statehouse, some Republicans were uncomfortable.