During its later service, the Stirling was used for mining German ports; new and converted aircraft also flew as glider tugs and supply aircraft during the Allied invasion of Europe during 1944–1945. In the aftermath of the Second World War, the type was rapidly withdrawn from RAF service, having been replaced in the transport role by the Avro York, a derivative of the Lancaster that had previously displaced it from the bomber role. A handful of ex-military Stirlings were rebuilt for the civil market.