Feb 12 (Reuters) - Japanese equities received their biggest weekly foreign inflows in 12 weeks, in the week ended on Feb. 5, boosted by upbeat earnings from domestic firms and hopes of a large U.S. fiscal stimulus package.

Data from Japanese exchanges showed foreigners were net buyers of stocks worth 856.48 billion yen ($8.17 billion) for the week to Feb. 5, the highest since Nov. 13.

They purchased 434.93 billion yen worth of derivatives and 421.55 billion yen in cash equities markets.

Some major Japanese firms posted better-than-expected earnings for the December quarter, which boosted local shares last week. Electronics firms Panasonic and housing-equipment-maker Toto raised their full-year earnings forecasts, while automobile firm Mazda Motor cut its loss forecast.

Last week, the Nikkei share average and the Topix index, both gained over 4% and marked their best week since November 2020.

Meanwhile, Japanese investors sold overseas equities worth 509.4 billion yen last week, marking a fourth successive week of net selling, finance ministry data showed.

($1 = 104.8300 yen)

(Reporting by Gaurav Dogra and Patturaja Murugaboopathy; Editing by Rashmi Aich)