The U.S. Supreme Court on Monday upheld the Securities and Exchange Commission’s efforts to take millions of dollars from an Orange County couple accused of swindling foreign investors but the decision did limit the government to targeting only the net profits of illegal conduct.

The court battle was tied to the case of Charles C. Liu and Xin “Lisa” Wang of Laguna Niguel, who raised $27 million from dozens of investors in China to build a proton beam radiation therapy center aimed at treating cancer, the SEC says.

The center was conceived under a government program in which immigrants can get a green card for themselves and their families if they invest a high enough amount and create enough jobs.

In promotional materials, the couple indicated the project would create more than 4,500 jobs in Southern California, according to the SEC.

The center was never built, and the SEC alleged that the couple transferred $11 million in investor money to firms in China and another $7 million to their own accounts.

A federal judge presiding over the case ordered the couple to “disgorge” $26.4 million, a legal term for requiring someone to give up profits made from wrongful conduct.

Liu and Wang challenged the order, claiming that the SEC had never been given the power to seek “disgorgements,” and the courts could not impose such a punishment.

They also contended that the $26.4 million penalty failed to account for their legitimate business expenses.

Justice Sonia Sotomayor, who authored the 8-1 ruling, wrote that the SEC can seek disgorgement amounting to no more than the net profits in a case, and ruled that the money must generally go to the investors.

Justice Clarence Thomas was the sole dissenter, writing the SEC did not have the power to “disgorge” money raised from stock frauds.

Attorneys for the couple could not be reached for comment.

The Supreme Court decision left it to the lower courts to determine how much the couple owe in light of the new ruling.