ST. PETERSBURG — Mayor Bill Foster and challenger Rick Kriseman emerged victorious from Tuesday's primary, easily defeating rival Kathleen Ford.What was most surprising Tuesday was just how close a race it was.The incumbent mayor came out on top by fewer than 1,000 votes. Foster ended the night with almost 41 percent of votes, compared to Kriseman's 39 percent, according to preliminary results.Losing her third bid for mayor, Ford trailed with 19 percent. Foster, who was celebrating with City Hall staffers and police union members at downtown's Midtown Sundries Sports Bar, said he wasn't surprised by the close results."We knew it would be close with the amount of money being spent," said Foster, referring to Kriseman's slightly bigger campaign chest that afforded the former lawmaker and City Council member the ability to buy television spots and glossy mailers.Looking forward to the Nov. 5 general election, Foster told supporters Tuesday that he has the momentum to carry the city forward."I'm going to run on my record," Foster said. "I expect him to run on his."Kriseman gathered with supporters, including council members Karl Nurse and Charlie Gerdes, at the Palladium Theater.After state Rep. Darryl Rouson energized the crowd, Kriseman walked to the stage with disco music filling the room."Tonight, we've taken a big step forward," he said. "This is just a step. Nothing more, nothing less."He reminded the crowd about his passion for the city and urged supporters to remain engaged in the coming weeks. To unseat Foster, Kriseman, 51, said he needs to win over Ford's supporters. Roughly 9,600 people voted for Ford in Tuesday's primary."We need their energy and ideas," he said. "I'm going to work hard to earn their vote."Foster, 50, said he isn't worried: "We have a pretty strong message. Let's keep it going. Look at the momentum we have."Surrounded by voters at downtown's Red Mesa Cantina, Ford said she has no plans to endorse a candidate and no further political ambitions. "I'm going to continue practicing law and do a little more kayaking," she said.Unofficial results show that Kriseman overwhelmingly won neighborhoods south of Central Avenue, many in predominantly African-American precincts. Foster's stronghold seemed to be in the city's northern precincts. The men split the city's west side.Although her campaign signs dominated black neighborhoods, Ford didn't win any precincts. She also lost runoffs in 2001 to Mayor Rick Baker and to Foster in 2009. The two other candidates, Anthony Cates III and Paul Congemi, each received less than 1 percent of the votes.It appears that Kriseman, who raised $156,000, was able to overcome the problem of not being on a citywide ballot in a decade. He served on the City Council from 2000 to 2006 and in the Florida House from 2006 to 2012.The race to Nov. 5 will be different than the lackluster primary.Both Foster and Kriseman vowed Tuesday to better differentiate themselves. Each said recent mayoral forums didn't provide a good opportunity to promote their visions. The race also could come down to cash.Kriseman's time in Tallahassee helped him raise more money than Foster. Raising even more is crucial. As of Friday, Kriseman had about $9,000 on hand, compared to Foster's $36,000."We're up against a well-funded incumbent mayor," Kriseman said Tuesday. "In the next 10 weeks or so, it won't be easy."Foster and Kriseman have similar positions on some major issues. Both favor allowing the Tampa Bay Rays to explore stadium sites outside the city as long as taxpayers are protected.They also support mass transit and the Greenlight Pinellas campaign.They do clash on issues involving public safety. Community policing and the Police Department's pursuit policy dominated the mayoral forums in black neighborhoods. Kriseman prefers a method where an officer is assigned to every neighborhood, a strategy scrapped by police Chief Chuck Harmon in 2006.Foster has countered that the program is alive and that Kriseman turned community policing into a buzz word to draw votes. The mayor loosened the pursuit policy in 2010 as a way to crack down on crime. Kriseman vows to make the policy more restrictive.At the polls Tuesday, residents were passionate about their choice.Mike and Nancy Moore, both 59, each voted to keep Foster in office."I like the fact that the crime rate is down," said Mrs. Moore, who lives in Coquina Key. "And I love the way the downtown area looks."Mike Greene, 55, used to believe in Foster, but stalls in the city's plan for Midtown led him to change his mind. He now supports Kriseman."The mayor is for predominately white citizens over here in St. Petersburg," he said. "Kriseman, I think he's been a little more clear on his position."Times staff writers John Cox and Daniel Paquette contributed to this report.