Jan Matejko was born in the Free City of Krakow, part of the Polish territory annexed by Austria during the Partitions of Poland. His father, Franciszek Ksawery Matejko (Czech: Frantisek Xaver Matejka) was a Czech from the village of Roudnice. He was a tutor and music teacher who first worked for the Wodzicki family in Koscielniki, then moved to Krakow, where he married the half-German, half-Polish Joanna Karolina Rossberg. Jan was the ninth child from eleven that his parents had. After the death of his mother in 1846, Matejko and his siblings were taken care of by his aunt, Anna Zamojska.
From his earliest days Matejko showed exceptional artistic talent that allowed him to advance from grade to grade, although he had great difficulty with other subjects. He never mastered a foreign language and did not do well even with his native Polish language. As a result, the public appearances he was obliged to make all his life must have been difficult for him.
At a young age he witnessed the Krakow revolution of 1846 and the 1848 siege of Krakow by the Austrians, the two events which ended the existence of the Free City of Krakow. His two older brothers served in them under General Jozef Bem and one died.
He attended St.Ann's High School, which he dropped out of in 1851 because of poor results. Despite that and because of his exceptional talent he studied at the School of Fine Arts in Krakow from 1852 to 1858 under Wojciech Korneli Stattler and Wladyslaw Luszczkiewicz.
During this time, he begun exhibiting historical paintings at the Society of Friends of the Fine Arts there (see e.g. Sigismund I Bestowing Nobility on the Professors of the University of Krakow in 1535.)
After studying under the historical painter Hermann Anschutz in Munich (1859)and then briefly and less successfully in Vienna, Matejko returned to Krakow, where he lived for the rest of his life and where, beginning in 1873, he was for many years the principal of the Academy of Fine Arts.
During the January Uprising of 1863 in which he did not participate because of poor health, Matejko gave financial support and transported arms to the insurgents' camp in Goszcza). In 1864 he married Teodora Giebultowska, with whom he had four children: Beata, Helena, Tadeusz, and Jerzy. In the same year he became a member of Scientific Society in Krakow.
At that time Matejko started to gain international recognition, literally a starving artist during his younger days, in 1865, his painting Skarga's Sermon won the gold medal at the annual Paris salon. It was subsequently purchased by Count Maurycy Potocki for 10,000 guldens.
In 1867, the painting Rejtan won the gold medal at the World Exhibition in Paris. French critics included Matejko among the most outstanding representatives of historical painting in Europe. Through his painting, he succeeded in reminding Europe that partitioned Poland still existed despite political realities.
Matejko died in Krakow and was buried in the center of the Alley of the Meritorious at Krakow's Rakowicki Cemetery.
In 1860 Matejko issued an illustrated album, Ubiory w Polsce (Clothing in Poland), a project reflecting his intense interest in historical records of all kinds and his desire to promote such interest among the Polish people in an effort to intensify their patriotic feelings. In 1861 he had an exhibition Otrucie krolowej Bony (Poisoning of Queen Bona) in Warsaw's Zacheta. The national defeats forced him to abandon the religious painting which, he believed, was his vocation and to devote himself almost exclusively to historical painting. In fact he created a vision of Polish history from which we can not liberate ourselves despite of perennial criticism of the scientists. Matejko often placed on his paintings people who were not present at this location (f.ex. Hugo Kollataj, and General Jozef Wodzicki, on The Battle of Raclawice). He was not interested in presenting factual events but in representation of a historical-philosophical synthesis. Matejko's work has to be viewed not only in artistic terms, but also in terms of the social function it performed and continues to perform today. He considered history as a function of the present and the future. His paintings are not historical illustrations, rather they are powerful expressions of the artist's psyche and his attitude to the world.
Matejko was focusing on major themes in Polish history and using historical sources to paint events in minute historical detail. He created two groups of historical paintings. The earlier one starting with the painting Stanczyk (1862) was directed against the magnates whose lack of patriotism caused, in his opinion, the fall of Poland. Stanczyk, the court jester to King Sigismund I (1437-1548), to whom Matejko gave his own features. The jester is presented as a symbol of the nation's conscience: he sits glumly in a chair apart from the other figures, alone in seeing that events during the wars against Moscow would ultimately end in tragedy. This group of paintings included among others also Kazanie Skargi (Sermon of Piotr Skarga's Sermon) (1864) and Reytan (1866).
The second group, painted after the defeat of January Uprising, is dedicated to famous events in Polish history. Matejko depicted many major events and battles in Polish history. His most famous work is Bitwa pod Grunwaldem (Battle of Grunwald) (1878) depicting the 1410 Polish and Lithuanian victory over the Teutonic Knights, a painting showing "clearly nationalist endeavour" which garnered it international acclaim as "an unrivaled icon of Polish nationalism". Other paintings in this group include Unia Lubelska (Union of Lublin) (1869), Stefan Batory pod Pskowem (Stefan Batory at the siege of Pskov) (1872), Kopernik (Nicolaus Copernicus), Dzwon Zygmunta (Sigismund's Bell) (1874), Hold Pruski (Prussian Tribute) (1882), Sobieski pod Wiedniem (Jan III Sobieski at the Battle of Vienna) (1883), Wernyhora, Kosciuszko pod Raclawicami (Tadeusz Kosciuszko at the battle of Raclawice) (1888), Dzieje Cywilizacji w Polsce (History of civilization in Poland) (1889) and Konstytucja 3 Maja (Constitution of the 3rd May) (1891). From 1890 to 1892 he also painted all of the Polish kings compiled in his book Portraits of Polish Kings (1890), his dedication to detail is evident in that he attended the opening of Queen Jadwiga's sarcophagus in 1887 to make sketches of her skull.
Altogether Matejko authored 320 oil paintings and several thousands drawings and watercolors. Finally he painted a monumental polychrome in St. Mary's Basilica, Krakow (1889-1891). His most important paintings were hidden during World War II (Bitwa pod Grunwaldem was buried in Lublin). After 1945 majority of his works was found and subject to restoration. They are now mainly in Warsaw's National Museum (Muzeum Narodowe w Warszawie).
His works, disseminated in thousands of reproductions, have made him one of the most famous painters in Poland, and became almost standard illustrations of many key events from the Polish history.