; and (B) to determine whether there is any criminal, national security, or other factor that would render the alien ineligible for such status. (2) Completion of background checks The security and law enforcement background checks of an alien required under paragraph (1) shall be completed, to the satisfaction of the Secretary, before the date on which the Secretary grants such alien permanent resident status under this section. (f) Treatment of aliens pending grant of permanent residence (1) Limitation on removal The Secretary or the Attorney General may not remove an alien who has pending an application for relief under this section and appears prima facie eligible for such relief. (2) Provisional protected status (A) In general In the case of an alien described in paragraph (1), the Secretary shall grant provisional protected presence to the alien and shall provide the alien with employment authorization effective until the date on which— (i) the alien’s application for relief under this section is finally denied; or (ii) the Secretary adjusts the status of the alien to that of an alien lawfully admitted for permanent residence. (B) Status during period of provisional protected presence An alien granted provisional protected presence is not considered to be unlawfully present in the United States during the period beginning on the date such status is granted and ending on a date described in subparagraph (A), except that the Secretary may rescind an alien’s provisional protected presence and employment authorization under this paragraph if the Secretary determines that the alien— (i) poses a threat to national security or a threat to public safety