William Henry Harrison was an American politician and military officer who became the ninth President of the United States of America. In the 1840 presidential election, Harrison defeated the incumbent, Martin Van Buren and was sworn in as President on March 4, 1841. Twenty-two days into his presidency, he contracted pneumonia and died nine days later on April 4, 1841 in the shortest presidency to date, lasting thirty-one days and became the first United States President to die in office.
Source
The White House. William Henry Harrison. Last modified 2006. https://www.whitehouse.gov/about-the-white-house/presidents/william-henry-harrison/.