A method for treating wastewater. The method comprises: providing a first dose of air to aerate a medium bed; supplying a dose of wastewater to the aerated medium bed; allowing nitrification of the wastewater to occur; allowing denitrification to occur; and providing a subsequent dose of air to the medium bed. A combined aerobic and anaerobic treatment apparatus. The apparatus comprises: a medium bed; a wastewater conduit in fluid communication with the medium bed; an air conduit in fluid communication with the medium bed; and where the combined aerobic and anaerobic treatment apparatus is configured to first allow a dose of wastewater in the medium bed to undergo a nitrification process which is generally aerobic, and then second allow the dose of wastewater in the medium bed to undergo a denitrification process which is generally anaerobic. An apparatus for treating wastewater. The apparatus comprises: means for providing a first dose of air to aerate a medium bed; means for supplying a dose of wastewater to the aerated medium bed; means for allowing nitrification of the wastewater to occur; means for allowing denitrification to occur; and means for providing a subsequent dose of air to the medium bed.