Richelieu's protege Mazarin, another cardinal, took over the job of prime minister during the minority of Louis XIV.
Mazarin replaced Richelieu as Louis XV's prime minister.
Cardinal Mazarin was the prime minister during the majority of Louis XV.