Japanese companies are beating analysts’ earnings expectations by the widest margin in almost three years, adding to the appeal of local stocks at a time when brokers are expecting a return of foreign investors after heavy selling.

With most Topix-listed companies except for some large financials having reported, earnings per share for the latest quarter have exceeded analyst estimates by 34% in aggregate, according to data compiled by Bloomberg. That’s the largest beat since the last period of 2017, and better than the 17% positive surprise posted by S&P 500 firms and the 6% margin for stocks in the MSCI AC Asia Pacific Index.

"Despite significant sales and profit declines year-on-year, 2Q results have tracked notably above consensus estimates, with positive surprises exceeding negative ones, especially in cyclical sectors such as automobiles and machinery,” Goldman Sachs strategists led by Kathy Matsui wrote in a Tuesday note.