Markets ended almost flat for the third consecutive session on Thursday after a mild intraday selling. The BSE Sensex ended at 58,305.07, up 54.81 points. The Nifty was at 17,369.25, up 15.75 points.