Perhaps it was the perfect spring weather, or maybe the high-profile presidential races. Whatever it was, Philadelphians came out to vote Tuesday in higher numbers than in recent years.

An unofficial count of machine voting showed that at least 402,834 of the city's slightly more than one million registered voters made a choice inside the booth. The 39 percent turnout is the third best in the city since 1988, when 48 percent of registered voters came out, according to data compiled by City Commissioner Al Schmidt.

The city's turnout was similar to the state's overall numbers.

Commonwealth Secretary Pedro A. Cortés announced Friday that more than 3.3 million voters cast ballots Tuesday statewide, resulting in a 40.5 percent voter turnout. That is just under the 42.7 percent turnout in 2008, when Democrats and Republicans also had an open primary.

Philadelphians also had a higher turnout in 2008 at 46 percent, according to Schmidt's analysis.

Fellow City Commissioner Lisa Deeley said that the city, which has a nearly 7-1 ratio of registered Democrats to Republicans, usually has a higher turnout during open Democratic primaries for the presidency.

But she said that the weather and other factors also helped drive voter turnout.

"It's been a very publicized election," Deeley said of the presidential race. "There's colorful candidates, the return of Hillary. . . . There were some local races that I'm sure played into turnout."

Tuesday's turnout numbers were an improvement over the abysmal showing last year during the open mayor's race, when only 27 percent of registered voters voted during the primary and just under 26 percent voted in the general election.

All paper ballots, including provisional and alternative ballots, still need to be counted for Tuesday's primary. An official final vote count should be ready by May 11, with certified results ready by May 15, Deeley said.

Problems at the polls were minor both in Philadelphia and throughout the state, according to authorities.

Cortés said the state worked closely with all 67 counties leading up to and during the election.

"A good election, like other successful undertakings, requires careful planning and execution," Cortés said in a statement. "Thanks to properly trained poll workers and well-informed electors, the election was carried out with little disruption."

215-854-5520 @InqCVargas