The actor dubbed "McDreamy" in the "Grey's Anatomy" hospital TV drama had claimed victory last week after an auction.
But a company that teamed up with Starbucks Corp. to bid for the Tully's chain filed an objection Wednesday.
AgriNurture Inc. had said it was still willing to proceed with its combined bid with Starbucks of about $10.6 million. The bid from Dempsey's company, Global Baristas LLC, which planned to keep Tully's intact, was for $9.2 million.
At a hearing Friday afternoon, Judge Karen Overstreet said the Jan. 4 auction was fair and no mistakes had been made.
Dempsey said he was "thrilled that we prevailed."
"I've been deeply humbled by the outpouring of support from the city of Seattle and am very proud to be a new business owner in this amazing city," he said in a statement. "We have a lot to accomplish over the next few months and years, and I am excited to now call Seattle my second home."
Zack Hutson, a spokesman for Starbucks Corp., said the company respected the judge's decision.
At the conclusion of a hearing Friday that lasted several hours, Overstreet said the auction and the arguments presented by all sides were intricate, but it was not her job to second-guess the decision made by Tully's executives to accept Dempsey's bid.
"Was it complicated? Yes. Did it produce a fantastic result for this case? Yes it did," Overstreet said.
Tully's has 47 shops in Washington and California with more than 500 employees. It filed for Chapter 11 bankruptcy protection in October, citing lease obligations and underperforming stores.
Tully's wholesale business, which includes Tully's Coffee in bags and single serve K-cup packs that are sold in supermarkets and other stores, is owned separately by Green Mountain Coffee Roasters Inc.
Scott Pearson, CEO of Tully's parent company, TC Global Inc., said the sale was a "step forward."
"I think the best part of it is we're taking care of our creditors and our employees and actually giving something back to our shareholders," Pearson said.
Dempsey has said he believed there is room in Seattle for Tully's and the much larger Starbucks, which is also based there.
After winning the auction last week, Dempsey made an appearance at a Tully's near Pike Place Market, shaking hands with workers and greeting customers before visiting other stores.