BOSTON -- It was almost done. Then it was dead. All of a sudden, a new deal with a similar result was back on. Then, in the one of the most dramatic non-waiver Trade Deadline deals in club history, the Red Sox sent superstar slugger Manny Ramirez to the Los Angeles Dodgers in a three-way deal that brought Pirates left fielder Jason Bay to Boston on Thursday afternoon.

The deal has already been announced by the Dodgers and Pirates, but the Red Sox still hadn't issued a press release or conducted media availability with general manager Theo Epstein. The club would only make the inevitable blockbuster official once all the paperwork was completed.

"The Red Sox will have no announcement tonight," Red Sox spokesman John Blake said via e-mail at midnight ET. "There are still issues to be finalized."

Once those issues are settled, the Red Sox will have dealt Ramirez, a centerpiece of their team since 2001 and a core member of two World Series championship teams.

Wearing a green T-shirt, shorts and a white doo rag over his head, Ramirez went to Fenway Park early Thursday evening and cleaned out his locker, declining to speak with several camera crews who were staking out the scene.

Ramirez returned to the park later Thursday night, went into the clubhouse and then left in a silver Mercedes with tinted windows. He declined to speak to reporters before driving onto Yawkey Way.

Bay, 29, appeared to be the only bat on the market who had comparable numbers to Ramirez this season. The right-handed-hitting Bay has a .282 average with 22 homers, 64 RBIs and a .519 slugging percentage. The 36-year-old Ramirez, who is having what is basically a par year by his standards, is hitting .299 with 20 homers and 68 RBIs.

As part of the swap, Red Sox reliever Craig Hansen and Triple-A outfielder Brandon Moss were both sent to Pittsburgh.

Hansen has yet to live up to his potential since being taken by Boston in the first round of the 2005 First-Year Player Draft. He is 1-3 with a 5.58 ERA in 32 appearances this season. Moss made several stints with the Red Sox and hit a dramatic, game-tying homer in the top of the ninth inning of the 2008 season opener at Tokyo Dome against the Athletics. In 78 at-bats for the Sox this season, the left-handed-hitting Moss was hitting .295 with two homers and eight RBIs.

According to SI.com, the Red Sox will pay the $7 million remaining on Ramirez's $20 million salary for this year. The Dodgers agreed not to pick up Ramirez's two $20 million club options for 2009 and '10, allowing him to become a free agent in November.

Though some players had privately gotten tired of Ramirez's unpredictability in recent weeks, others were sad to see him go.

Manny Ramirez

"From a personal standpoint, I'm sad because I got to know Manny," said Red Sox shortstop Alex Cora. "But at the same time, I feel it's the best, not only for him, but for us as a team. Compare it with the Mets' situation earlier in the season [with then-manager Willie Randolph]. Like Manny said, 'Let's turn the page and move on.' We are a good team and we are still capable of winning and we know what it takes to bring another ring for the city."

The blockbuster move literally came down to the buzzer, just like it did in 2004, when the Sox traded Nomar Garciaparra to the Cubs. That time, Boston won the World Series despite trading an icon. Red Sox general manager Theo Epstein has never been afraid to be bold, as he once again demonstrated on Thursday.

Ramirez had become increasingly disenchanted in recent weeks as his relations with club executives had soured. When the season started, it seemed as if he was never happier.

That made his recently erratic behavior harder to understand for members of the team.

"The hard part for me was this derailed into a train wreck so quick, so fast, and so oddly," Red Sox right-hander Curt Schilling, who hasn't pitched this season because of injury, told WEEI-850 AM on Thursday. "You had the Buddha Zen Master guy in Spring Training, reading and [saying] 'Life is good; don't worry, be happy,' and it just looked like he was poised to have a monster season. Physically, he worked his butt off."

Things started to turn ugly on June 28, when Ramirez put traveling secretary Jack McCormick, who is 64 years old, to the floor during a pregame spat over tickets. The club didn't announce discipline for Ramirez, but it's believed he received a substantial fine, which went to a charitable organization.

More recently, Ramirez asked out of the lineup before the finale of a road trip in Seattle and then the opener against the Yankees because of right knee soreness. There was some dispute about the severity of the injury, and the Red Sox reportedly plotted disciplinary action against Ramirez if he was again unavailable on July 26 against the Yankees. But Ramirez returned that day, which is when rumors of a trade first surfaced.

Once Ramirez let it be known he would waive his no-trade rights, the Red Sox started working the phones, as they've often done in previous years.

This time, they found a taker.

Initially, the Red Sox had spoken to the Marlins and Pirates about a three-way deal that would have sent Ramirez to Florida, Bay to Boston and Jeremy Hermida to Pittsburgh. That deal fell apart in the early afternoon hours of Thursday.

But the Dodgers swooped in, and the Pirates stayed in the mix with Bay, enabling the Sox to move Ramirez.

"It really wasn't many hours at all," Colletti said of how quickly the deal developed. "Theo reached out to me in midmorning and wanted to gauge our interest, and I said, `You know what? We have an interest.' Then, we probably spent the next two-plus hours hammering it out. This wasn't on the board for very long."

A fixture in the middle of the Red Sox's batting order since 2001 and a core member of two World Series championship teams, Ramirez ended his near eight-year run with the Red Sox by going 0-for-3 in Wednesday's loss to the Angels.

The deal reunites Ramirez with former teammates Derek Lowe and Garciaparra.

"It's nice to see we've done something like this, to make a push for the next two months," Garciaparra said. "I think he'll be just fine. Manny is really a simple person. He works extremely hard. He just wants to play baseball and go home and be with his family. How can you not respect and love a guy like that?"

Ultimately, the Red Sox decided their best chance to repeat as World Series champions was to part ways with Ramirez.

The team has struggled since the All-Star break, going 4-8.

The Sox will play their first game without Ramirez -- and presumably their first with Bay -- on Friday night at Fenway when the Oakland Athletics come to town.