In his last years, Pushkin was again in government service in St. Petersburg. He married in 1831 and had to spend a lot of time in society at court. He wrote more and more prose. He wrote a history of Peter the Great and a historical novel "The Captain's Daughter". He kept asking the tsar to let him resign from his job and go to the country to spend his time writing. The tsar would not allow that. In 1837, Pushkin was killed in a duel. He had been forced to fight the duel in order to defend his wife's honour.