Two years after Google Inc. began a big push in China, Baidu.com Inc. continues to dominate the country's Internet search market, thanks in significant part to a controversial and legally risky offering: searches for free, unlicensed music downloads.

Now, Google is preparing a counterstrike, according to people close to the situation. The U.S. search giant is in the late planning stages of a joint venture with a Chinese online music company that would permit it to provide free -- licensed -- music downloads in China.

The service, which is likely to offer access to tunes from three global music companies as well as dozens of smaller players, could start in the next several weeks barring any last-minute hiccups. The music pact marks a turning point in Google's battle with Baidu to gain dominance in an Internet market that is soon expected to surpass the U.S. this year in number of users.

Baidu has proved a brash adversary for the much larger Google, leveraging its status as hometown champion in China to beat the U.S. Internet giant at its own game. From the start, Baidu has boasted that its knowledge of China and the Chinese language would give it a natural advantage over foreign rivals.

"We've been the No. 1 Web site in China for a number of years, and in fact we are the largest Web site outside of the U.S.," says Robin Li, Baidu's co-founder and chief executive. "When people get to know about the Internet, the first Web site they learn is about Baidu in China."