The markets snapped the three-day losing streak and ended firm on Tuesday after a choppy session. The benchmark index closed at 10,822 levels. After a firm opening, it plunged to 10,185 levels in early deals. In the broader markets, the Nifty gained 3.8 per cent or 118 points to close at 3199 levels.