Markets ended flat on Friday. The BSE Sensex closed at 58,786.67, down 20.46 points or 0.03%. The Nifty was at 17,511.30, down 5.55 points or 0.03%.