In any annexation proceedings instituted by a city or town, the council thereof may, subject to the approval of the special court in which the case is pending, and prior to twenty-one days after entry of an annexation order, or within twenty-one days after denial of a petition for appeal or within twenty-one days after the entry of the mandate in an appeal which has been granted, by ordinance duly adopted decline to accept annexation on the terms and conditions imposed by such court. In such case the court shall enter an order dismissing the motion to annex, and shall direct the payment of the entire costs of the proceedings by the city or town, including reimbursement of the county of costs incurred by it in defending the suit, including such reasonable attorneys' fees, engineering fees, witness fees and other costs as such court shall determine and allow.
Va. Code § 15.2-3213