Having successfully won re-election as House speaker on Thursday, Rep. Nancy Pelosi, D-Calif., is once again second in line to become president — at least on an interim basis — according to the rules of the presidential line of succession.

Pelosi, 78, in her second stint as speaker, now falls behind Vice President Mike Pence, 59, to take over if President Trump , 72, is unable to perform his duties as commander in chief. After Pelosi, rounding out the top five, are Sen. Chuck Grassley, R-Iowa, Secretary of State Mike Pompeo, and Treasury Secretary Steven Mnuchin.

Article 2, Section 1, Clause 6 of the Constitution states that in the event that a sitting president or his or her vice president is unable to act as commander in chief, owing to either removal, or inability due to death or otherwise, Congress has the power to declare "what Officer shall then act as President, and such Officer shall act accordingly until the Disability be removed, or a President shall be elected.”

Furthermore, a law suggested by President Harry S. Truman in 1945 cements her position in the succession line, according to TIME.

After President James Garfield’s assassination in 1881, the Oval Office was almost left vacant because Vice President Chester A. Arthur, the first and only person in the line of succession at the time, was unwell, and Congress was out of session (Arthur did take on the role of president and served from 1881 to 1885.) In 1886, Congress passed a new Presidential Succession Act which made the secretary of state next in line after the vice president.

Years later, Truman requested that the speaker of the House and Senate president pro tempore (a position currently held by Grassley, that is reserved traditionally for the senator with the longest record of continuous service) come ahead of secretary of state on the list. Truman sought to ensure that the president be unable to name his or her own successor and said that the two congressional leaders “came closest to being elected by all voters of the nation.” Congress approved his recommended changes in 1947.

Democrats have long eyed impeachment proceedings against Trump, and a California Democrat reintroduced a measure Thursday — the first day of the 116th Congress in which Democrats took control of the lower chamber — that accuses Trump of obstruction of justice in special counsel Robert Mueller’s FBI investigation. Mueller’s inquiry focuses on possible connections between the Trump campaign and administration with Russian officials in order to influence the 2016 presidential election, and has been a major point of contention between the two major political parties in the country.