The BSE smallcap index rose 3.26 percent and BSE midcap index added 1.24 percent.
Indian indices ended marginally lower for the second consecutive week ended January 3 on the back of global developments.
The escalating geopolitical tension hit investor sentiment after a senior Iranian military official was killed by a US airstrike.
Brent crude prices surged more than four percent in the session on January 3 and gold prices also climbed to a four-month high as tensions mounted in the Middle East.
NYMEX crude rallied over 4 percent to hit a high of $63.84/bbl, the highest level since May 2019 and COMEX gold rallied to hit a high of $1543.7/oz, the highest level since September in the session on January 3.
On the global front, during the past week, US major indices touched record highs after fresh economic stimulus from China added to optimism fueled by easing trade tensions between in the two countries. However, US indices ended the week with little change.
In the domestic market, the Nifty finished at a closing high level and inched closer to its record high level of 12,293.90 in Thursday's trading session.
"A small negative candle was formed this week with lower shadow. This pattern signals a broader range movement in the Nifty around 11,290-11,120 levels," said Nagaraj Shetti, Technical Research Analyst, HDFC Securities.
"The upside strength of the Nifty is still intact, there is a possibility of an attempt of new all-time high formation by next week (above 12,293), but the Nifty could encounter hurdle at 12,350-400 levels," he added.
In the past week, the Sensex shed 110.53 points (-0.26 percent) to end at 41,464.61, while the Nifty shed 19 points (-0.15 percent) to end at 12,226.7.
Foreign institutional investors (FIIs) remained net buyers in the past week as they bought equities worth Rs 497.32 crore, while Domestic Institutional Investors (DIIs) also bought equities worth of Rs 29.61 crore.
In the past week, the Indian rupee shed 45 paise to end at 71.80 on January 3 against its December 27 closing of 71.35.
"Nifty closed negative for the second consecutive week. On a lower time frame, the sideways action has taken the form of a triangular pattern. On the higher side, the index needs to surpass the level 12,300 on a closing basis in order to resume the rally," said Gaurav Ratnaparkhi, Senior Technical Analyst, Sharekhan by BNP Paribas.
"On the downside, 12,200-12,150 will be the key support zone to watch out for. Failure to hold on to the supports would mean deeper is in the offing," he added.
The BSE small-cap index rose 3.26 percent, BSE mid-cap index added 1.24 percent while the BSE large-cap index was down 0.12 percent in the past week.
On the BSE, L&T added the most in terms of market value, followed by UltraTech Cement and Tata Motors. On the other hand, ICICI Bank lost the most in terms of market value.
The Nifty Metal index outperformed the sectoral indices with a gain of over 3 percent during the week.
Exclusive offer: Use code "BUDGET2020" and get Moneycontrol Pro's Subscription for as little as Rs 333/- for the first year.