The Thunder acquired guards Kevin Martin and Jeremy Lamb, two first-round picks and a second-round pick in the surprising deal. Oklahoma City also sent center Cole Aldrich and forwards Daequan Cook and Lazar Hayward to Houston.
The Oct. 31 deadline to extend Harden or allow him to become a restricted free agent next July had been hanging over the Thunder from the moment they reported to training camp.
"We wanted to sign James to an extension, but at the end of the day, these situations have to work for all those involved. Our ownership group again showed their commitment to the organization with several significant offers," Thunder general manager Sam Presti said in a statement.
"We were unable to reach a mutual agreement, and therefore executed a trade that capitalized on the opportunity to bring in a player of Kevin's caliber, a young talent like Jeremy and draft picks, which will be important to our organizational goal of a sustainable team."
The small-market Thunder had already signed Kevin Durant, Russell Westbrook and Serge Ibaka to long-term deals, and apparently realized Harden was going to want a bigger salary than they would offer.
The Thunder got back a good scorer in Martin, who has averaged 18.4 points in his eight NBA seasons, and a promising young player in Lamb, the No. 12 pick in the draft who helped Connecticut win the 2011 NCAA championship. He led Houston's summer league team in scoring with 20 points per game.
But Harden was a huge part of Oklahoma City's success and had said he might even be open to sacrifice dollars in order to stay with the Thunder. But they've been unwilling to climb into the luxury tax, which will only become harsher under the new collective bargaining agreement.
Harden averaged 16.8 points and 3.7 assists last season, and joined Durant and Westbrook on the U.S. men's Olympic team. He struggled badly in Oklahoma City's loss to Miami in the NBA Finals, but the Thunder felt good about their chances of getting back there with another year of experience for their young stars, all 24 or younger.
However, Yahoo Sports reported that Harden turned down a four-year contract worth about $52 million, and the Thunder moved quickly to trade him after that.
The Rockets rebuilt their roster in the offseason and hoped to land Dwight Howard. Houston traded or released just about every veteran except Martin, who was in the final year of his contract and due about $13 million this season.
Martin averaged 17.1 points and 2.8 assists last season, his eighth in the NBA and third in Houston. He missed the last 26 games last season with a shoulder injury, though he also developed a rift with Houston coach Kevin McHale late in the season.
The Rockets have until Wednesday to sign Harden to the extension that Oklahoma City couldn't.
"While I never like having to send out quality players like Kevin Martin and Jeremy Lamb, this trade gives us a chance to make an immediate impact on the future of our franchise moving forward," Rockets owner Leslie Alexander said.
"James Harden was part of Team USA's gold medal team at the London Olympics and is one of the most skilled shooting guards in the NBA."
New Rockets point guard Jeremy Lin also chimed in about the trade on Twitter.
"Really sad to see Kmart and JLamb go," Lin wrote. "...both class acts and great teammates. Welcome Harden, Cook, Aldrich and Hayward to Houston!!"
Houston collected draft picks while it was making a flurry of deals, part of a package to offer Orlando for Howard. The Rockets traded point guard Kyle Lowry to Toronto for a lottery-protected first-round pick, one of Oklahoma City's acquisitions on Saturday night.
The other first-round pick was acquired by Houston when it traded Jordan Hill to the Los Angeles Lakers last March. The second-round pick came to the Rockets in a deal that sent guard Courtney Lee to Boston.