She has also become a thorn in the side of the court itself, which is controlled by allies of the president. In late March, the Supreme Court judges issued a ruling stripping the country’s legislators of power and granting themselves the ability to write laws. Ms. Ortega held a news conference and said the move was a “rupture of the constitutional order.”

The move set off speculation that members of Mr. Maduro’s party were turning against him. Soon after, the president ordered the court to reverse much of its ruling. Ms. Ortega has continued to fight the court, issuing a legal challenge against the legitimacy of its judges’ elections, a move that irked Mr. Maduro’s allies.

Yet despite her open dissent, no official moves have been taken to stop her — until now.

In his complaint against Ms. Ortega, Mr. Carreño said that the attorney general had tried to “violate, threaten and undermine the fundamental principles of the Constitution” and that she acted “with a grave and inexcusable ignorance” of the country’s laws.

“She should not just be dismissed — she can and should be prosecuted,” he added.

José Vicente Haro, a constitutional law expert in Caracas, the capital, said that while the court had the ability to open an investigation into wrongdoing, only the National Assembly, controlled by opposition lawmakers, could remove her from office. However, many expect the court could remove her anyway given its pattern of decision making that experts have considered legally dubious during a year of mounting pressure against the president.