The Big Apple Circus, which shut down and filed for bankruptcy last year, is coming back — and just in time for its 40th anniversary.

On Tuesday, the United States Bankruptcy Court for the Southern District of New York approved a decision by the circus’s board to accept a $1.3 million auction bid from Big Top Works, an affiliate of the corporate-restructuring firm Compass Partners.

Immediately, the Big Apple Circus announced that it would return this fall for the 2017-18 season, which would coincide with the 40th anniversary of the circus’s first performance in 1977.

Details of the coming season — including whether the Big Apple Circus would return to Damrosch Park at Lincoln Center, where it has held its shows since the 1980s — will be announced this spring.