Can foreigners buy real estate in Japan?

Foreigners are allowed to obtain Japanese real estate

Nowadays, there are no legal limitations or tax-related differences when foreigners obtain Japanese real estate. You may purchase real estate regardless of what your nationality is, where you live, and whether you have residence status or not. However, there are differences in the documents needed by residents and non-residents (mainly documents for confirming the person's identity) and in the requirements for an account at a Japanese bank with regards to receiving purchase funds and paying taxes on real estate after purchase.

A foreigner can acquire proprietary rights to Japanese real estate just like a Japanese national. Proprietary rights to land in Japan by a foreigner is also permitted.
There is no time limit to proprietary rights, and it can be bought, sold and inherited freely among foreigners. The tax paid by a foreigner at the time of purchase is also the same as that paid by a Japanese.

How are residents and non-residents defined ?

A resident is an individual whose residence is in Japan or who has been in Japan for at least one year continuously up to the present. If a person resides in two or more countries, that person's "assumed residence" is based on such details as his/her work situation and contract.
A non-resident is an individual who resides outside of Japan.