Sobieski was the oldest child of Jakub Sobieski and his second wife Teofila Zofia Daniłłowicz. He was born on 24 May 1628 in Złoczów and spent his childhood in Żółkiew. He grew up in a patriotic family, and his mother often took him and his brother to the grave of her grandfather Stanisław Żółkiewski, Grand Hetman of the Crown, who was killed in the battle of Cecora in 1620. Zofia Teofila Daniłłowicz taught her sons the inscription upon their great-grandfather's grave: "O quam dulce et decorum est pro patria mori!" (How sweet and glorious it is to die for one's homeland!). On 29 October 1639 Sobieski became Starosta of Jaworów.