Nils Ahnlund (23 August 1889 – 11 January 1957) was a Swedish historian. He was professor of history at the then-Stockholm University College 1928–1955, and became a member of the Swedish Academy in 1941. He was the father of physician Hans Olof Ahnlund, literary scientist Knut Ahnlund and the grandfather of journalist and writer Nathan Shachar.