(CNN) -- South Carolina's Supreme Court ruled Thursday that Gov. Mark Sanford must accept $700 million in federal stimulus money, ending the only formal effort by a governor to reject funding intended to jump-start an ailing economy.

Gov. Mark Sanford became the conservative face of opposition to the federal stimulus package.

The two-term Republican said he would abide by the court ruling, but called it a bad day for South Carolina and the country.

"This decision is terrible news for every taxpayer in South Carolina, and even more so for future taxpayers who will ultimately bear the responsibility of paying for this so-called 'stimulus' without seeing any benefit from it," he said in a statement.

Considered a potential future Republican presidential candidate, Sanford led the party's resistance to the $787 billion stimulus package. He warned the increased spending will bring an insurmountable debt burden on future generations.

Sanford initially tried to require that any stimulus money pay down the state debt, a stance rejected by the Obama administration.

Sanford had resisted taking the money even when the Republican-controlled legislature passed a budget that included the funds.

Students and education officials in South Carolina filed lawsuits demanding that the governor take the money. Sanford tried to have those suits merged and heard in federal court.

On Monday, however, a federal judge rejected that effort, and said that the South Carolina Supreme Court must decide what to do.

In its ruling, the state's highest court said the legislature, not Sanford, has the power to decide whether to accept the federal stimulus money.

"At this stage in the process, the Governor certainly has no discretion to make a contradictory decision on behalf of the State," the ruling said. "We hold the Governor must apply for the ... funds." Watch report on Gov. Sanford's policy defeat »

However, the court distanced itself from any role in setting policy on the issue.

"Our decision today should not be construed as a comment on the policy differences between Governor Sanford and the General Assembly respecting the wisdom or necessity of South Carolina accepting the" money, it said. ... "We discharge our duty to honor the rule of law, nothing more."

The ruling was in response to lawsuits filed by two students and a school administrators' association that sought to force the state to accept the stimulus money, some of which will go for education needs.



CNN's Tom Cohen and Peter Hamby contributed to this report.

All About Mark Sanford • South Carolina • Economic Stimulus