President Barack Obama delivers a speech at the Prince Georges Community College, Sept. 26, 2013 in Largo, Md. Obama is engaged in a fierce battle with the GOP, keeping him from traveling overseas. (Photo by Mark Wilson/Getty Images) (Mark Wilson/Getty Images)

The Illinois legislature may vote as early as next week to legalize same-sex marriage – capping a months-long and racially-delicate debate that has tested President Obama’s enduring influence over the politics of his hometown.

A vote on the measure in the state House was abruptly delayed last spring amid rising anxiety among some black lawmakers from Chicago who faced an awkward dilemma – stuck between the support for the bill from their favorite son in the White House and the stiff opposition from some of the city’s most influential black pastors.

For a time over the summer, it looked like the pastors were winning.

Leading the charge was the Rev. James T. Meeks, the politically savvy pastor of the sprawling Salem Baptist Church in Chicago, who taped robocalls expressing his opposition to gay marriage and connecting thousands of black constituents to their local legislators.

On its face, the measure seemed like a sure bet in Democrat-dominated Springfield. Gay rights activists filled the House chamber on the legislature’s final day in session in May anticipating a historic victory. Obama, the former Illinois senator, had mentioned the pending House vote during a fundraising stop in Chicago that week, saying: “I just want to say for the record it’s something that I deeply support.”

But then the state House didn’t act.

It turned out that the pressure was too much to bear for a number of lawmakers, who quietly asked for a delay.

Irritation was growing in the African American caucus. Some circulated lists showing how campaign contributions from gay donors had historically flowed only to white Democrats, yet now they were supposed to go against powerful constituents in their home districts. Some expressed frustration that they were being asked to take a stand on gay marriage while little was being done to curb gun violence and poverty in their embattled neighborhoods.

“There is all due respect to the president, but your influence only goes so far,” one skeptical lawmaker, Rep. Monique Davis (D), said over the summer, “especially when the caucus perceives that it, too, has some big issues no one is thinking about. Their children are dying.”

Referring to Obama’s decision to announce support for gay marriage at the height of his 2012 reelection campaign, Davis added: “His voice on this issue is not the same as his voice on almost all the other issues we hear about. People feel he made a political promise, and he’s trying to fulfill his promise.”

Lawmakers reported getting an earful from constituents in response to the recorded calls from  Meeks.

Obama “has tremendous sway in Chicago,” Meeks said in an interview over the summer. “However, on this issue, I think people had made up their minds.”

Obama’s largely passive role in the Illinois debate was an early indicator that his declining clout may have been extending even into the state capital where his political career was born.

In addition to his remarks in Chicago on the eve of the vote, he said at a gay rights reception at the White House in June that he would “continue to support marriage equality and states’ attempts to legalize it, including in my home state of Illinois. We're not giving up on that.”

Beyond that, it wasn’t clear even to supporters of the measure that more direct involvement would make a difference, according to people familiar with legislative discussions.

White House spokesman Shin Inouye would not say whether Obama planned to do anything in advance of next week’s vote.

Supporters of the bill regrouped and began an elaborate lobbying campaign.

They distributed videos with personal stories of gay couples. They contacted voters. And they produced a radio ad, featuring audio clips of Obama and wife Michelle endorsing legalized same-sex marriage in civil-rights terms, with two black women discussing the first couple’s support.

“Listen to what President Obama had to say,” one says, cueing a clip from his January inaugural address when he said: “Our journey is not complete until our gay brothers and sisters are treated like anyone else under the law, for if we are truly created equal, then surely the love we commit to one another must be equal as well.”

“So our president’s out there for marriage equality?” one of the women asks. The other replies: “And Michelle, too.” Then a clip is played from a past interview in which the first lady endorses legalizing gay marriage as a way to end discrimination.

Sponsors of the bill say they believe they now have the votes to win passage next week. They said they focused their lobbying not just on skeptical black lawmakers, but some white Catholic Democrats and centrist Republicans.

“There was quite an array of folks who made the request for more time,” said Rep. Kelly Cassidy (D), who is a lesbian and one of the bill’s chief sponsors. She said she and her colleagues pushing the bill “took them at their word” and spent the summer traveling the state to make the case for same-sex marriage.

A version of the bill has already passed the state Senate. The House version would make the law effective June 1. Cassidy said the Senate would pass that version, and the governor would surely sign it into law.

People familiar with lawmakers’ deliberations said the pressure remains intense as next week’s session approaches. Undecided legislators are receiving calls from advocates on both sides. Frank Bass, a lobbyist working with the anti-gay marriage pastors, said he thinks the bill’s backers are “short by about three or four votes.”

“I still don't see it passing, but it will be a very close vote,” Bass said.