Answer
Two times, between 1777-1778 and 1816-1820. Catherine, Archduchess of Austria, took the regency of Portugal in place of her son Joseph, then Queen Maria I's husband, who was mentally ill. Her first regency was interrupted by the Conspiracy of the Bees after which she was replaced by her son in the Council of Regency.