Bank lending rose at its fastest pace in two years in June, Bank of Japan data showed Tuesday, as higher raw material costs increased short-term funding needs and energy-related firms took out more loans.

Loans excluding those by credit associations quickened for a sixth month, rising 2 percent from a year earlier, the BOJ said.

Lending by Japan's 10 city banks, which include Mitsubishi UFJ Financial Group Inc. and Mizuho Financial Group Inc., rose 0.9 percent, the second monthly gain.

The expansion in lending by banks excluding credit associations was the fastest since July 2006, when the BOJ raised its key interest rate from near zero percent.

Lending by regional banks continued to outperform those by larger lenders, rising 3.2 percent in June from a year earlier.

"Banks are lending more to large companies that need more working capital because of soaring raw material prices," said Michio Kitahara, associate director general of the BOJ's surveillance department.

"There were also a number of large loans to companies in energy-related sectors such as steel and oil and to automobile and electrical companies," Kitahara said.