(3) Restricted medicaid benefits (A) Clarification of entitlement Subject to the restrictions under subparagraph (B), for the purpose of providing aliens with eligibility to receive medical assistance— (i) paragraph (1) shall not apply, (ii) aliens who would be eligible for medical assistance but for the provisions of paragraph (1) shall be deemed, for purposes of title XIX of the Social Security Act [ 42 U.S.C. 1396 et seq.], to be so eligible, and (iii) aliens lawfully admitted for temporary residence under this section, such status not having changed, shall be considered to be permanently residing in the United States under color of law. (B) Restriction of benefits (i) Limitation to emergency services and services for pregnant women Notwithstanding any provision of title XIX of the Social Security Act [ 42 U.S.C. 1396 et seq.] (including subparagraphs (B) and (C) of section 1902(a)(10) of such Act [ 42 U.S.C. 1396a(a)(10)(B) , (C)]), aliens who, but for subparagraph (A), would be ineligible for medical assistance under paragraph (1), are only eligible for such assistance with respect to— (I) emergency services (as defined for purposes of section 1916(a)(2)(D) of the Social Security Act [ 42 U.S.C. 1396 o(a)(2)(D)]), and (II) services described in section 1916(a)(2)(B) of such Act (relating to service for pregnant women). (ii) No restriction for exempt aliens and children The restrictions of clause (i) shall not apply to aliens who are described in paragraph (2) or who are under 18 years of age. (C) Definition of medical assistance In this paragraph, the term “medical assistance” refers to medical assistance under a State plan approved under title XIX of the Social Security Act [ 42 U.S.C. 1396 et seq.].