Dempsey's company will pay $9.15 million for Tully's and complete the purchase later this month after the court hearing, he said in a statement.
"I'm thrilled that we won and I'm even more excited about saving Tully's Coffee and its hundreds of jobs," he said. "Tully's is a great company with committed employees, and with its base in Seattle, one of the world's greatest cities, I'm confident we will be able to successfully build the brand and help grow the economy. "
Tully's Coffee has 47 company-owned locations in Washington and California. The company, with more than 500 employees, filed for Chapter 11 bankruptcy protection in October.
Dempsey, who gained the nickname "McDreamy" on the TV show "Grey's Anatomy" set in a fictional Seattle hospital, has said he wants to rescue the chain.
"Seattle has been very good to me over my career, and I am honored to have the privilege to own Tully's and work closely with the company's employees," he said in his statement.