Aug 18 (Reuters) - Foreigners were net buyers of Japanese stocks for a second straight week in the week ended Aug. 12 as risk-on buying kicked in after a cooling U.S. inflation raised hopes that the Federal Reserve might slow the pace of interest rate increases.

Overseas investors bought Japanese stocks worth a net 393.85 billion yen ($2.91 billion) last week, marking their biggest weekly purchase since July 22, data from exchanges showed.

They purchased 122.9 billion yen in cash equities and acquired 270.95 billion yen worth of derivatives, in a fourth straight week of net buying.

Last week, fears about red-hot U.S. inflation eased as data showed that consumer prices were unchanged in July compared with June, which raised hopes that inflation would have already peaked.

Japanese top equities' benchmarks — the Nikkei share average and the Topix index — both gained about 1.3% last week, posting a second straight weekly rise.

The Nikkei index hit a more than seven-month high of 29,222.77 earlier this week, as a rally on Wall Street and a fresh set of robust corporate earnings domestically boosted sentiments.

Meanwhile, Japanese bonds lost a net $289.4 billion yen in cross-border outflows in the week, that marked the first weekly net selling in seven weeks, by outsiders.

Non-Japanese bonds drew a net 1.09 trillion yen worth of funds from Japan, although equities saw disposals, worth 234.8 billion yen, in a second subsequent week of net selling. ($1 = 135.2100 yen)

(Reporting by Gaurav Dogra and Patturaja Murugaboopathy in Bengaluru; editing by Uttaresh.V)