World champions Serbia will meet nine-time Olympic gold medallists Hungary in the group stage of the men's water polo competition at this year's Olympic Games in Rio de Janeiro.
This came in a draw following the conclusion of the final qualification tournament in Trieste yesterday.
Serbia, winners of a second successive Olympic bronze medal at London 2012 before winning the 2015 World Championship title in Kazan, are the top seeded team in the group.
They also won the European Championships in Belgrade in January, beating Montenegro in the final as Hungary took the bronze medal.
Hungary, the Olympic gold medallists at Sydney 2000, Athens 2004 and Beijing 2008 before crashing out in the quarter-final stage at London 2012, will be seeking to build on the form they showed when winning the qualification tournament.
World bronze medallists Greece are also in Group A along with Australia, Japan and hosts Brazil.
Defending Olympic champions Croatia will face a rematch of the London 2012 final against Italy in Pool B, where they will be hoping to repeat their 8-6 victory in 2012.
Montengro, fourth last time around, will also feature in the 12-team tournament as well as United States, Atlanta 1996 champions Spain and France.
The US will be chasing a second successive gold medal in the eight-team women's tournament after victories at London 2012 and Kazan 2015.
Spain, beaten 8-5 by US in the final four years ago, will be among their opponents in Group B, along with Hungary and China.
World bronze medallists and Athens 2004 Olympic champions Italy will go in Group A.
Their opponents will consists of Sydney 2000 winners Australia, Russia and hosts Brazil.
Beijing 2008 winners and world silver medallists The Netherlands failed to qualify.
Action is due take place between August 9 and 19 at the Maria Lenk Aquatic Center.
A full breakdown of the draw can be found here.