(1) In general A foreign corporation which during the taxable year derives any income
(A) from real property located in the United States, or from any interest in such real property, including
(i) gains from the sale or exchange of real property or an interest therein,
(ii) rents or royalties from mines, wells, or other natural deposits, and
(iii) gains described in section
631 (b) or (c), and
(B) which, but for this subsection, would not be treated as income effectively connected with the conduct of a trade or business within the United States,
may elect for such taxable year to treat all such income as income which is effectively connected with the conduct of a trade or business within the United States. In such case, such income shall be taxable as provided in subsection (a)(1) whether or not such corporation is engaged in trade or business within the United States during the taxable year. An election under this paragraph for any taxable year shall remain in effect for all subsequent taxable years, except that it may be revoked with the consent of the Secretary with respect to any taxable year.
(2) Election after revocation, etc. Paragraphs (2) and (3) of section
871 (d) shall apply in respect of elections under this subsection in the same manner and to the same extent as they apply in respect of elections under section
871 (d).