The block party at the public housing complex in Northeast Washington was rollicking when the mayor arrived, shaking his hips to the music and chuckling as someone shouted, “Vince Gray! Vince Gray!”

“What’s up, y’all,” Gray responded as two women escorted him to a stage, where a community leader introduced him as the city’s mayor and “hopefully mayor again.” Another speaker took the microphone and asked the crowd: “He’s our next mayor, right?”

There were cheers, and Gray, his eyes concealed by sunglasses, appeared delighted. But he offered no answer to the question looming over politics in the District: Will he run for reelection next year?

With the Democratic primary less than nine months away, the uncertainty over the mayor’s future is unsettling the city’s political world, which is already skittish after having endured a litany of corruption scandals over the past several years.

Three D.C. Council members and a fourth Democrat have announced campaigns to succeed Gray. But his silence, alongside an ongoing federal investigation into his 2010 campaign, is freezing potential supporters and donors unsure of who will run and making it difficult for declared candidates to formulate strategy.

“He’s in limbo, and while that hangs out there, the race will not feel fully jelled,” said Tom Lindenfeld, a political consultant advising council member Muriel Bowser (D-Ward 4), who announced her candidacy in March. “Until he decides what he’s doing, all eyes stay on the mayor.”

Gray provided no clarity when asked in an interview whether he would seek reelection. “I don’t know the answer to that yet, but I’ll never walk away from service,” he said, adding that he has no timeline for a decision. “I’ll know it when it comes.”

Asked if he could quickly assemble a campaign and fundraising operation to keep up with his opponents, he said, “I think so.” Then he added: “The short answer is ‘Yes.’ ”

A year ago, as prosecutors bore down on the mayor’s campaign, a chorus of critics demanded his resignation, including three council members. Gray’s survival became a recurring topic of political discourse, but the speculation faded as the mayor insisted that he was performing his job.

In time, the talk became about whether he would run again.

Every day, it seems, the mayor maintains a packed schedule, presiding at ribbon-cuttings, visiting senior centers and touring neighborhoods, where he hands out flyers listing successes beneath the headline, “Why the District of Columbia is the Place to Be.” His office issues a regular stream of pronouncements with titles such as “Mayor Vincent C. Gray Announces Accomplishments of Mayor’s Commission on HIV/AIDS” and “Mayor Gray Celebrates Completion of Sherman Avenue Streetscape Project.”

At a recent groundbreaking for subsidized housing in Mount Pleasant, the mayor spoke like a man ensconced in his job, saying he would return “when we cut the ribbon in 15 months.”

“¡Que viva Vincent Gray!” Council member Jim Graham (D-Ward 1) shouted. The mayor beamed.

An hour later, Gray toured a senior center in Columbia Heights, where an administrator greeted him at the door with a message from the center’s chief executive: run for reelection.

“Thank you,” Gray replied, walking into the dining room, where several dozen African American seniors had assembled for lunch. A frail man asked, “Are you going to make more affordable housing for seniors?”

“Yes,”Gray replied. “So we can keep people in the city who want to stay.”

An elderly woman asked, “Can I shake your hand?”

“And a hug,” the mayor said, enveloping the woman in his long arms.

In other parts of town, in settings more freewheeling, the reception is not always so warm.

On July 4, the mayor walked in the annual parade in predominantly white Palisades, where he was greeted with a mix of general indifference, tepid applause, and one boo.

While Bowser crisscrossed MacArthur Boulevard, smiling, shaking hands and sticking campaign decals on kids, Gray focused on handing out strings of red, white and blue beads.

After one youngster shouted, “Hurray for Mr. Gray!,” a member of the mayor’s entourage exhorted the boy: “Say it louder!”

Campaign investigated

Once defined by poverty, crime and government dysfunction, the District over the past 15 years has become known for its revived downtown and for formerly rundown neighborhoods turning into havens of affluence.

The city’s reputation for corruption — at its apex in the 1990s when Marion Barry (D) was mayor — waned after Barry was succeeded by Anthony A. Williams (D). Yet over the past several years, the city has been jolted by a series of scandals, including the prosecutions of three sitting or former council members, Democrats Harry Thomas Jr., Kwame R. Brown and Michael A. Brown.

During the same period, U.S. Attorney Ronald C. Machen Jr. probed an illegal, $653,000 campaign to elect Gray, the funding allegedly provided by businessman Jeffrey Thompson. Two of Gray’s campaign aides and a consultant have pleaded guilty, and Machen has said the probe is ongoing, roiling the city’s political class and fueling speculation that prosecutors are trying to implicate the mayor himself. Gray has denied any wrongdoing.

“Instead of being able to celebrate successes, we have to explain our shenanigans,” said Stanley Mayes, a member of the District’s Democratic state committee. “There’s this undercurrent of, ‘Oh Lord, what’s going to happen next?’ ”

As the investigation unfolded, Gray sought to project the image of a mayor focused on his job. At the same time, council members and civic leaders have praised him for his management, pointing to a budget surplus, declining crime and unemployment rates, and the persistence of construction cranes downtown.

“He has a pretty amazing record,” said Bryan Weaver, a Democratic activist who supported former mayor Adrian Fenty. “But — and the huge ‘but’ — is that people feel the government’s more corrupt than it has ever been.”

Anwar Saleem, a Democrat who backed Gray, said he hasn’t committed to any candidate because “there are too many uncertainties.” Referring to the mayor, Saleem said, “If you take away the legal issues, he has done great.”

“I’d like the prosecutor to make a decision,” he said. “The prosecutors are holding the city hostage right now.”

Jim Abdo, a developer who backed Gray in 2010, said he hasn’t chosen a candidate in next year’s election, even as he praised the mayor’s fiscal stewardship. “I’d love to wholeheartedly be able to throw my support behind him,” he said.

“Tell me this cloud of culpability goes away, and I’m in,” Abdo added. “You want certainty, and you need certainty with that level of leadership.”

Rivals pressing ahead

The Democrats who have declared their candidacies are pressing forward. Bowser is fundraising and door-knocking. Council member Jack Evans (D-Ward 2) opened an office and hired staff. Council member Tommy Wells (D-Ward 6) has met with potential donors and implored them to support him. A fourth candidate, Reta Lewis, a former State Department official, is hoping the electorate is thirsting for an outsider.

Gray, for his part, said he’s always talking to potential voters by virtue of his job. “I campaign every day,” he said one afternoon, stopping to pose for a photo with two sanitation workers on Georgia Avenue NW.

Even if he runs, it’s unclear who would lead Gray’s campaign, because the investigation has tarnished his 2010 team. Still, for an incumbent possessing fundraising clout, a late launch is not necessarily a disadvantage. Fenty began raising money nearly two years before his reelection bid, and lost. But Williams began his first race less than four months before the primary and won by 15 percentage points.

As voters await his decision, the mayor traverses the city, displaying his flair for governing, if not glad-handing. During a tour of Benning Road NE, Gray walked past a few customers at a nail salon and asked, “Where are the permits at?” A few minutes later, at a gas station, he berated the cashier for selling rolling papers.

At the block party at the Lincoln Heights housing complex, the mayor ate a burger and hugged strangers. After he departed, Pat Malloy, a community leader who hopes that Gray runs again, said she has learned to live with the mayor’s uncertainty.

“If he chooses to run, fine. If not, that’s fine too,” she said, adding that she’s confident she can get along without him.

“The mayor doesn’t make all the decisions,” she said.