When Has A President Been Denied His Party's Nomination?

This question is from Michael Stubbs of Cincinnati, Ohio:

When was the last time, if ever, that a sitting president was not nominated by his party for a second term?

It only happened once to an elected president. That was Franklin Pierce, the 14th president, who was elected as a Democrat in 1852. His pro-Southern sentiments and his policy of failing to lead on the divisive issue of slavery badly hurt his standing with the voters. Especially damaging was his support for the pro-slavery Kansas-Nebraska Act of 1854, which backfired on him as Kansas was overrun by pro-slavery forces, mostly from the slave state of Missouri. The events angered Northerners everywhere and helped lead to the creation of the Republican Party. When Democratic delegates gathered in Cincinnati for their convention in 1856, it was clear that they had had enough of Pierce. James Buchanan, who had been defeated by Pierce for the nomination four years earlier, won the nomination on the 17th ballot.

Four other presidents were denied the nomination of their party, but none of these were elected in their own right. They were:

John Tyler, Whig, 1844. Tyler became president in 1841 following the death of William Henry Harrison. Tyler, a conservative Southerner, was out of step with many in the Whig Party, which instead nominated Henry Clay for president.

Millard Fillmore, Whig, 1852. Fillmore also ascended to the presidency following the death of the incumbent. In this case it was Zachary Taylor, who died in 1850. Taylor's death left the Whigs in disarray, and the party convention chose Gen. Winfield Scott over Fillmore and Daniel Webster.

Andrew Johnson, Democrat, 1868. Johnson, a Southerner and a Democrat, was chosen to be part of a Republican unity ticket led by President Abraham Lincoln in 1864. Following Lincoln's assassination the following year, Johnson tried in vain to win the support of the late president's allies; in fact, he was impeached and nearly convicted by a GOP Congress. The Democratic nomination went to Horatio Seymour.

Chester Arthur, Republican, 1884. Arthur was picked for VP by James Garfield in 1880 in order to help the GOP carry New York. Following Garfield's assassination in 1881, Arthur alienated his erstwhile allies by attacking the patronage system that had helped his career until that point. Arthur lost the GOP nomination to James Blaine.