James Gandolfini's gang and HBO's hit men have agreed to stop bludgeoning each other in the media, a tense peace has broken out, and the two sides plan to announce within the next 48 hours that Gandolfini will be back for a fifth season on "The Sopranos."

"There is an optimism in the air," Gandolfini spokesman Dan Klores said yesterday.

The actor has agreed to drop the breach-of-contract lawsuit that he filed two weeks ago in Los Angeles Superior Court, claiming the pay-cable network failed to give him proper notice in 2001 that his option for a fifth season would be picked up. He sought release from his contract.

HBO, which hit back with a suit claiming Gandolfini would be liable for losses of $100 million if he failed to return to the series, has agreed to drop its countersuit. But it will do so only when it has official documentation that Gandolfini's suit has been dropped with prejudice. That would mean he can't refile it in two weeks if he's not happy with the way salary negotiations are going, which is what prompted his lawsuit in the first place, sources said.

As of late yesterday, HBO was still awaiting that paperwork.

Network sources said that HBO also is insisting that Gandolfini agree to come back to work under terms of his original contract, which calls for him to be paid about $400,000 per episode to star in the fifth season's 13 episodes. Negotiations would restart once he does do.

Gandolfini sources, however, said the two sides have agreed to "cut right down the middle" the difference between the $11 million per season -- twice the actor's current salary -- that HBO had at one point put on the table during salary negotiations and the $16 million Gandolfini sought.

Brad Grey, whose Brad Grey Television produces the drama series with HBO and who was not named in Gandolfini's lawsuit, talked the actor into dropping the legal action over the weekend, according to sources from both sides of this fight. That Los Angeles meeting "totally brought the temperature down," said one executive caught up in the tension.

Last week HBO sent letters to cast and crew letting them know that the show would not go back into production on March 24, as scheduled.

Gandolfini was attempting to bring his salary more into line with those of stars on high-rated broadcast TV series. But unlike broadcast networks, which come up against a deadline during high-stakes salary negotiations so as not to miss premiere week in the fall, HBO could simply put "The Sopranos" on ice and wait Gandolfini out. HBO does not debut series at a set time each year; for instance, nearly 16 months elapsed between the close of the third season of "The Sopranos" and the start of its fourth, with no apparent loss of viewers.

Sources say James Gandolfini (with "Sopranos" co-star Edie Falco) will drop his suit against HBO.