An image recording apparatus comprising: a head having a nozzle configured to eject a liquid; a maintenance unit configured to perform maintenance of the head; and a controller, wherein the maintenance unit includes: a wiper tank of which upper part is opened and which is configured to store a cleaning liquid; a wiper (53, 54) configured to move to a first position at which the wiper is capable of making contact with a nozzle surface of the head and to a second position at which the wiper is immersed in the cleaning liquid stored in the wiper tank; a flushing foam configured to absorb the liquid ejected from the nozzle; a flushing tank of which upper part is opened and which is configured to accommodate the flushing foam; a supply pump configured to supply the cleaning liquid to a first tank being one of the wiper tank and the flushing tank; and a discharge pump configured to discharge the cleaning liquid from the wiper tank and the flushing tank, the maintenance unit is configured such that the cleaning liquid is supplied, via the first tank, to a second tank being remaining one of the wiper tank and the flushing tank; and in a case that the controller supplies the cleaning liquid to the first tank, the controller is configured to perform a first processing of cleaning the first tank, under a condition that an elapsed time is less than a first threshold value, the elapsed time being a time elapsed since cleaning of the second tank or since a first predetermined processing regarding the second tank performed first after the cleaning of the second tank, and the controller is configured to perform a second processing of cleaning the second tank by adding the cleaning liquid to the first tank, under a condition that the elapsed time is not less than the first threshold value. a head having a nozzle configured to eject a liquid; a maintenance unit configured to perform maintenance of the head; and a controller, wherein the maintenance unit includes: a wiper tank of which upper part is opened and which is configured to store a cleaning liquid; a wiper (53, 54) configured to move to a first position at which the wiper is capable of making contact with a nozzle surface of the head and to a second position at which the wiper is immersed in the cleaning liquid stored in the wiper tank; a flushing foam configured to absorb the liquid ejected from the nozzle; a flushing tank of which upper part is opened and which is configured to accommodate the flushing foam; a supply pump configured to supply the cleaning liquid to a first tank being one of the wiper tank and the flushing tank; and a discharge pump configured to discharge the cleaning liquid from the wiper tank and the flushing tank, a wiper tank of which upper part is opened and which is configured to store a cleaning liquid; a wiper (53, 54) configured to move to a first position at which the wiper is capable of making contact with a nozzle surface of the head and to a second position at which the wiper is immersed in the cleaning liquid stored in the wiper tank; a flushing foam configured to absorb the liquid ejected from the nozzle; a flushing tank of which upper part is opened and which is configured to accommodate the flushing foam; a supply pump configured to supply the cleaning liquid to a first tank being one of the wiper tank and the flushing tank; and a discharge pump configured to discharge the cleaning liquid from the wiper tank and the flushing tank, the maintenance unit is configured such that the cleaning liquid is supplied, via the first tank, to a second tank being remaining one of the wiper tank and the flushing tank; and in a case that the controller supplies the cleaning liquid to the first tank, the controller is configured to perform a first processing of cleaning the first tank, under a condition that an elapsed time is less than a first threshold value, the elapsed time being a time elapsed since cleaning of the second tank or since a first predetermined processing regarding the second tank performed first after the cleaning of the second tank, and the controller is configured to perform a second processing of cleaning the second tank by adding the cleaning liquid to the first tank, under a condition that the elapsed time is not less than the first threshold value.