During the Peninsular War of 1809-1811 he held an intendancy in the patriot army. He became, in 1812, director of the University of San Isidro; but having offended the government by establishing a chair of international law, he was imprisoned for five years (1815-1820). The revolution of 1820 reinstated him, but the counter-revolution of three years later forced him into exile. After four years he was allowed to return, and he died, in 1834, a member of the supreme council of war.
González-Carvajal enjoyed European fame as author of metrical translations of the poetical books of the Bible. To fit himself for this work he commenced the study of Hebrew at the age of fifty-four. He also wrote other works in verse and prose, avowedly taking Luis de León as his model.