The first 2020 presidential debate will be divided into two nights later this month, with senators Elizabeth Warren and Cory Booker going up against the former congressman Beto O’Rourke in the first session. The former vice-president, Joe Biden, will face off with South Bend’s mayor, Pete Buttigieg, and senators Kamala Harris and Bernie Sanders on the second evening.

NBC announced the lineup on Friday for its two-night debate, which will begin 26 June in Miami, and is set to be the first direct showdown between the Democrats vying to take on Donald Trump.

Representatives of 20 campaigns gathered in a conference room at NBC headquarters Friday as candidates’ names were picked out of two boxes. There were separate boxes containing the names of candidates polling at or above 2% and those who polled below 2% – an attempt to make sure most of the lesser-known candidates were not grouped together.

Still, four of the six top-polling candidates landed on 27 June, setting the stage for a high-stakes evening.

The first night of the Democratic presidential candidates debates will feature: (top, left to right) senators Cory Booker, Elizabeth Warren, Amy Klobuchar, former congressman Beto O’Rourke, and Mayor Bill de Blasio of New York; (bottom, left to right) former congressman John Delaney, congressmembers Tim Ryan, Tulsi Gabbard, former HUD secretary Julian Castro, and Governor Jay Inslee. Photograph: Reuters File Photo/Reuters

Being paired with Biden, 76, and Sanders, 77, could give Buttigieg an opportunity to emphasize the “next generation” theme that he has been touting. At 37, the mayor is the youngest of the leading contenders. Sanders and Warren, considered favorites of the party’s liberal wing, won’t be going head-to-head.

Among the rest of the field, Washington’s governor, Jay Inslee, could use the opportunity of a night less crowded with frontrunners to draw attention to his climate-change agenda. Colorado’s former governor, John Hickenlooper, who has been among the most aggressive critics of Sanders’ democratic socialism, will have a chance to make those points to him face-to-face.

Featured on 26 June will be Warren, Booker, O’Rourke, Inslee, Minnesota Senator Amy Klobuchar, former Housing and Urban Development secretary Julián Castro, New York City Mayor Bill de Blasio, former congressman John Delaney of Maryland, congresswoman Tulsi Gabbard of Hawaii and congressman Tim Ryan of Ohio.

The next night’s lineup has Biden, Sanders, Harris, Buttigieg, Hickenlooper, the New York senator Kirsten Gillibrand, the Colorado senator Michael Bennet,the author Marianne Williamson, the entrepreneur Andrew Yang and the congressman Eric Swalwell, of California.

NBC will face its own test, to see if it can make compelling programming out of crowded, fractious stages on the opening nights of debate season. The debate will be shown both nights in prime time, 9pm to 11pm, on the broadcast network, as well as on MSNBC and Telemundo, and it will be streamed on various platforms. The NBC personalities Lester Holt, Savannah Guthrie, Chuck Todd, Rachel Maddow and José Diaz-Balart will be featured.