Updated from 2:40 p.m. EST

Google ( GOOG) jumped 4% Tuesday after the most-used search engine dodged a protracted legal battle.

The stock jumped $14.10 to close at $351.16 after the Justice Department agreed to limit the scope of a subpoena, according to Bloomberg News.

"We are very pleased," a Google spokeswoman said in an interview on CNBC.

The government probe is linked to a law designed to prevent the sale of Internet pornography to minors. Google has opposed the probe, citing the need to maintain user privacy and trade secrets.

"Google should fight for its users' privacy interest," says Lauren Gelman, of Stanford Law School's Center for Internet and Society, in an email. "In a digital era, so much of our personal information is held by third parties. It's important that they fight to keep that information private. We also need to have a public debate on whether current privacy laws need to be updated to better protect user privacy."

Google and the government agreed in private negotiations to limit the scope of the original request, which had originally sought a week's worth of search queries and 1 million Web addresses, Bloomberg said. District Court Judge James Ware said Tuesday he is likely to grant at least some of the restricted request. The government has received similar data from Yahoo! ( YHOO) and Microsoft ( MSFT).

At the hearing in San Jose, Calif., a lawyer for the Justice Department said that the government would like to have a random selection of 50,000 Web addresses and 5,000 random search requests from Google, according to The Wall Street Journal. Ware told lawyers in the case that he would rule on the case "very quickly," the Associated Press said.

This is one of the first bits of good news for Google investors, in a year that has seen the company miss fourth quarter Wall Street earnings estimates and stumble into a series of communications snafus.

Google investors were concerned that the Mountain View, Calif.-based company would face a potentially long and costly legal battle. In addition, they were worried that users would shy away from Google applications that require the company to store personal information such as email if there was a chance that the data would wind up in the hands of the government.

"Investors tend to get nervous around DOJ issues," says Denise Garcia, an analyst with WR Hambrecht who rates Google buy. "Absolutely, it will help alleviate their fears."