Donald Trump has clinched the Republican presidential nomination, the Associated Press said Thursday. 

Based on its delegate count, the AP said Trump has reached 1,238 delegates, one over the number necessary to take the nomination. That number includes the pledged delegates Trump has won throughout the primary elections as well as some unpledged delegates that have told the AP they will support Trump. 

Trump became the presumptive nominee when Texas Sen. Ted Cruz and Ohio governor John Kasich dropped out of the race. Securing enough delegates, however, ensures he will be the nominee and will avoid a contested convention in July. 

There are still 303 delegates at stake in the last five state primaries on June 7, many of whom will likely go to Trump.

The real estate mogul has been a controversial candidate from the beginning of the race, and has faced opposition from some Republican party leaders, including former GOP candidate Mitt Romney and former presidents George W. Bush and George H. W. Bush.

House Speaker Paul Ryan, the highest ranking Republican in office, has also said he is not ready to endorse Trump, but the two have met to attempt to find common ground.