He was born in Groningen, the son of the banker Klaas Mesdag and his wife Johanna Wilhelmina van Giffen.
He married Sina van Houten in 1856, and when they inherited a fortune from her father, Mesdag retired from banking at the age of 35 to pursue a career as a painter.
In 1870 he exhibited at the Paris Salon and won the gold medal for The Breakers of the North Sea.
In 1880 he received a commission from a Belgian company to paint a panorama giving a view over the village of Scheveningen on the North Sea coast near The Hague.
With the help of Sina and students he completed the enormous painting, Panorama Mesdag,— 14 m high and 120 m around — by 1881.