At age 54, Lamar retired to Richmond with his new family and wrote of his calm happiness there. While living in Richmond, he compiled a book of poems written throughout his life, titled Verse Memorials, published in 1857, and gathered materials for a proposed history of Texas, including biographical information on Stephen F. Austin. He also served as a trustee of Calvary Episcopal Church. Later that year, President Buchanan appointed him Minister to Nicaragua and Costa Rica with the objective of securing ratification of a treaty of commerce, friendship, and navigation with Nicaragua. He returned to Richmond in October 1859 with a monkey and a parrot for his daughter, then suffered a heart attack and died on December 19, 1859, at age 61. He was buried in Morton Cemetery in Richmond.