Matejko began collecting materials for the painting in 1871. He started painting the canvas some time in 1872 and finished it in 1878. Soon afterwards, he received a scepter from the council of Kraków in an official ceremony, in recognition of his work and his position as one of the most respected Polish artists. The painting was sold that year to Dawid Rosenblum, a private individual in Warsaw. Displayed in numerous international exhibitions, in 1902 the painting was bought from Rosenblum's heirs by the Society for the Encouragement of Fine Arts ("Towarzystwo Zachęty Sztuk Pięknych") and displayed in Warsaw.