Igor Stravinsky was the son of Fyodor Stravinsky, the principal bass singer at the Imperial Opera, St Petersburg, and Anna, née Kholodovskaya, a competent amateur singer and pianist from an old-established Russian family. Fyodor's association with many of the leading figures in Russian music, including Rimsky-Korsakov, Borodin and Mussorgsky, meant that Igor grew up in an intensely musical home. In 1901 Stravinsky began to study law at St Petersburg University, while taking private lessons in harmony and counterpoint. Having impressed Rimsky-Korsakov with some of his early compositional efforts, Stravinsky worked under the guidance of the older composer. By the time of his mentor's death in 1908 Stravinsky had produced several works, among them a ♯ minor (1903–04), a ♭ major (1907), which he catalogued as "Opus 1", and in 1908 a short orchestral piece, Feu d'artifice ("Fireworks").
In 1909 Feu d'artifice was performed at a concert in St Petersburg. Among those in the audience was the impresario Sergei Diaghilev, who at that time was planning to introduce Russian music and art to western audiences. Like Stravinsky, Diaghilev had initially studied law, but had gravitated via journalism into the theatrical world. In 1907 he began his theatrical career by presenting five concerts in Paris; in the following year he introduced Mussorgsky's opera Boris Godunov. In 1909, still in Paris, he launched the Ballets Russes, initially with Borodin's Polovtsian Dances from Prince Igor and Rimsky-Korsakov's Scheherazade. To present these works Diaghilev recruited the choreographer Michel Fokine, the designer Léon Bakst and the dancer Vaslav Nijinsky. Diaghilev's intention, however, was to produce new works in a distinctively 20th-century style, and he was looking for fresh compositional talent. Having heard Feu d'artifice he approached Stravinsky, initially with a request for help in orchestrating music by Chopin to create the ballet Les Sylphides. Stravinsky worked on the opening "Nocturne" and the closing "Valse Brillante"; his reward was a much bigger commission, to write the music for a new ballet, The Firebird (L'oiseau de feu) for the 1910 season.
Stravinsky worked through the winter of 1909–10, in close association with Fokine who was choreographing The Firebird. During this period Stravinsky made the acquaintance of Nijinsky who, although not dancing in the ballet, was a keen observer of its development. Stravinsky was uncomplimentary when recording his first impressions of the dancer, observing that he seemed immature and gauche for his age (he was 21). On the other hand, Stravinsky found Diaghilev an inspiration, "the very essence of a great personality". The Firebird was premiered on 25 June 1910, with Tamara Karsavina in the main role, and was a great public success. This ensured that the Diaghilev–Stravinsky collaboration would continue, in the first instance with Petrushka (1911) and then The Rite of Spring.