 Resenting the conservative and ultra-catholic policies of the Spanish court, he embraced the pro-French government of José I Bonaparte once Napoleon invaded Spain and replaced the Bourbon dynasty with his own brother Joseph (José).After publicly acknowledging José I as lawful King of Spain, Urquijo was called back to court and became Prime Minister again.He remained in office during all of the reign of José I, from 7 July 1808 to 27 June 1813.