A Nicaraguan Supreme Court justice who was President Daniel Ortega’s closest legal adviser before he resigned this week accused the president and his wife of running a brutal government that tramples on civil rights and is driving the nation to the brink of civil war.

The justice, Rafael Solis, was speaking in an interview with The New York Times after his resignation on Thursday, which marked the highest-profile defection yet in the country’s nine-month-old political crisis. Government critics said it signaled a possible weakening of the political apparatus that has helped keep Mr. Ortega and his wife, Vice President Rosario Murillo, in power long after hundreds of thousands of people took to the streets demanding their ouster.

Mr. Solis was unsparing in his criticism of Mr. Ortega, who he had been allied with since the 1970s.

“The separation of powers in Nicaragua is over,” he said. “The concentration of power is in them, those two people.”