San Francisco on Wednesday chose the high-tech team of Google and EarthLink to bring free, wireless Internet access to virtually everyone in the city, possibly by the end of the year.

The two companies, which were recommended by a city panel evaluating the project, beat out five other bidders for a chance at the highly coveted contract.

After a contract is negotiated by the city, reviewed by the Board of Supervisors and the network built, residents will be able to log on wirelessly whether at home, in a park or at work.

"I am still hopeful, and maybe I'm a cockeyed optimist, that we can finish this year," said Chris Vein, executive director of San Francisco's technology department.

In choosing to negotiate with the Google-EarthLink team, the city is going with two Internet giants with marquee names. Both firms have deep pockets and proven track records online, but only limited experience building a large wireless network.

The project, championed by Mayor Gavin Newsom, is intended to boost the city's technology credentials and help bridge the digital divide between the Internet haves and have-nots. It has also generated intense interest from other cities looking to build similar networks.

For its part, Google, in Mountain View, intends to provide the free, so-called Wi-Fi (wireless fidelity) access. The service it proposes would be faster than dial-up but slower than a typical broadband connection.

In its joint bid, Earthlink plans to offer speedier access, but for a fee. No price has been set, but EarthLink plans to charge around $20 a month in other cities where it is negotiating Wi-Fi contracts, including in Philadelphia and Anaheim.

Google's interest came as a surprise to many because the company's primary focus is as a search engine; it's the nation's leader. Google executives have said that they consider the project an experiment for testing online advertising based on where a user is located. Some have speculated that this could be a seed for a national Google Wi-Fi network, though Google has said it currently has no plans to do so.

Both companies would share the cost of installing the necessary equipment, estimated at up to $12 million. San Francisco will pay nothing and actually reap some fees by leasing city property as perches for Wi-Fi antennas.

Megan Quinn, a spokeswoman for Google, said "we are thrilled that the city of San Francisco has accepted our joint bid with EarthLink to provide Wi-Fi access citywide."

Donald Berryman, executive vice president of EarthLink, in Atlanta, said: "We are ecstatic. This is great news for us. We had some tremendous competitors."

The city panel that issued its recommendation Wednesday evaluated bids based on criteria such as financial stability, the area of Internet coverage and an oral interview. The Google-EarthLink duo was ranked first by a relatively thin margin over MetroFi, which offers citywide Wi-Fi in Sunnyvale, Santa Clara and Cupertino.

Newsom has a close relationship with Google. He's friends with the company's co-founders and has joined them on a chartered jet from Switzerland (he reimbursed the company about $1,000).

However, Vein, with the city's technology department, said the relationship didn't influence the panel and that he expressly told members at the outset: "Make sure you are making your own decision."

The five panelists included two members of the technology department, Joseph John and Brian Roberts, two staffers from the city's Public Utilities Commission, Hans Loffeld and Bram Elias, plus Greg Richardson, an outside consultant from Civitium, a Georgia consulting firm that helps cities build wireless Internet networks. As is common practice, their identities were kept secret until Wednesday to guard them against undue influence by outsiders.

Next on San Francisco's to-do list is for the city's technology department to negotiate the contract with Google and EarthLink, a process that can take several months. If no deal is reached, the city can turn to the second-place bidder.

After a contract is agreed upon, the issue goes to the Board of Supervisors and various city departments for permitting.

It remains to be seen whether residents will use the Wi-Fi system as a replacement for their wire-based Internet connections. Early fears by the mayor that the telecommunications industry would fight the project by filing lawsuits have yet to materialize.