* NSE gains as much as 2.1 pct to record 6,537.8 points
* BSE hits record high for second daily session
* Domestic-focused firms outperform, IT shares fall (Adds foreign investor buying data, paragraph 3)
By Abhishek Vishnoi and Rafael Nam
MUMBAI, Mar 7 (Reuters) - India's NSE index rose as much as 2.1 percent to a record high, and the benchmark BSE index hit its record for a second consecutive session, as foreign investors bet big in a country that just months ago was gripped by market turmoil.
The broader NSE's all-time high of 6,537.80 points surpassed its previous high of 6,415.25 hit on Dec. 9, although the benchmark BSE got there first, hitting a record high on Thursday and again on Friday.
As in December, foreign investors are driving the rally, posting on Friday their biggest daily purchases since Dec. 9, or a net 25.77 billion rupees ($420.73 million). That marked a 16th consecutive buying session for a net total of about $1.4 billion.
The strong buying is confounding expectations that foreign investors would turn cautious ahead of general elections due to start on April 7 and conclude by mid-May.
Expectations that the opposition Bharatiya Janata Party, led by its prime ministerial candidate, Narendra Modi, would win those elections are helping spark some of the gains, amid widespread perceptions it has a more business-friendly stance than the ruling Congress-led coalition.
But analysts say the rally could also signal a longer-term bet on a rebound in India's economy, given signs that foreign investors are switching from exporters, which had attracted the bulk of overseas buying last year, to domestic-focused sectors.
"One-way buying by overseas investors is supporting the gains. We expect sectors, which are connected to the core economy such as infrastructure, capital goods and metals are likely to see more buying interest," said Suresh Parmar, head of institutional equities at KJMC Capital Markets.
The NSE ended up 2 percent, or 125.50 points, posting its biggest daily percentage gain since Nov. 25. The 50-member index rose nearly 4 percent for the week.
The BSE index rose 1.9 percent, or 405.92 points, after earlier setting a record high at 21,960.89 points. It rose 3.8 percent for the week.
For the year, foreign investors have bought a net $850 million in shares, after buying $20 billion worth last year.
Overseas funds have also turned into strong buyers of debt, with net purchases of $4.9 billion so far this year, helping partly reverse their net sales of $8 billion in debt in 2013.
The strong buying is a stark turnaround from last year when India was struggling to contain a record-high current account deficit, sending the rupee to a record low of 68.85 to the dollar in late August.
However, strong curbs on gold imports imposed by the government, including a 10 percent duty, has helped narrow the current account deficit, leading to a more stable currency.
The rupee reached up to 60.9450 to the dollar, its strongest level since Dec. 9.
BETTING ON INDIA
Domestic-focused shares were among Friday's top gainers, amid signs of increased foreign buying on rising expectations for the economy to rebound from its slowest growth in a decade this fiscal year.
Overseas holdings in shares of capital goods companies since mid-September rose 37.4 percent to $12.78 billion by Feb. 28, regulatory data shows, while overseas holdings in banks rose 10.9 percent.
Biggest private sector lender ICICI Bank surged 6 percent, while State Bank of India rose 4.6 percent.
Other rate-sensitive stocks rallied on expectations of a fall in inflation after the central bank raised interest rates aggressively since September. India's largest real estate developer, DLF Ltd, jumped 9.7 percent.
Larsen & Toubro Ltd, India's biggest engineering and construction firm, jumped 4.9 percent.
But exporters fell, with Infosys Ltd losing 2.4 percent and Sun Pharmaceutical Industries Ltd dropping 1.4 percent, reversing last year's trend of foreign investors betting big on drugmakers and software services exporters. ($1=61.2500 Indian rupees) (Additional reporting by Indu Lal; Editing by Eric Meijer and Clarence Fernandez)