The 22-year-old won with a total of 16.041, as USA's Danell Leyva claimed silver and Russia's David Belyavskiy took bronze.
World champion You Hao finished eighth, as China left the Rio gymnastics competition without a title.
It was the first time they have not won gold in the sport since 1980.
China boycotted the Moscow Games that year.
Verniaiev missed out on the all-around title by just 0.101 points after hopping forward when dismounting the high bar.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.
Find out how to get into gymnastics with our special guide.

The cuts, which will be spread across the country, represent 7.5% of the company's 16,000-strong workforce.
The move follows the merger earlier this year of the two networks which together have 30 million customers.
At the time analysts warned the move would mean some staff overlap and would therefore mean a reduction in staff numbers.
The jobs will go from back office, headquarters and management.
The group said no cuts would be made among customer service or store staff.
Its main offices are in London, Bristol and Hatfield, Hertfordshire.

The government is seeking support from Labour MPs to extend the RAF's air campaign to strikes against IS targets in Syria, as well as Iraq.
Labour has hinted it would not oppose action in Syria, as it did in 2013.
Ms Harman will join senior ministers and military chiefs at Tuesday's National Security Council meeting.
The last time a Labour leader received such an invitation was in 2013.
The prime minister believes IS fighters need to be confronted in Syria, where the US are conducting operations, but will not take military action without a Commons vote.
Some Conservative backbenchers have expressed doubts about further action in the absence of a wider diplomatic strategy so Mr Cameron is reluctant to ask MPs to vote to extend the campaign unless he has Labour's backing.
A Number 10 spokesman said: "The PM thought it was important to ensure the leader of the opposition was fully briefed on the current situation."
Shadow defence secretary Vernon Coaker has also been invited.
Earlier this month, Ms Harman said Islamic State had to be "stopped" and Labour would look "very seriously" at any proposals brought forward by the government.
She said the situation was different from that in 2013, when Labour voted against air strikes in Syria, because IS was a terrorist organisation, while President Bashar al-Assad was the head of a government, albeit a "terrible regime".
Labour had been concerned about "what would fill the space" if the Syrian president had been toppled, Ms Harman added.
Mr Cameron was defeated in the Commons in 2013 when Tory rebels joined forces with Labour to oppose air strikes on Syrian government targets designed to deter the use of chemical weapons.
The 2013 vote focused on the Syrian president, not IS militants.
Parliament approved UK bombing of militant positions in Iraq last year. However, MPs were not asked at the time to authorise strikes across the border in Syria.
The National Security Council meeting comes as ministers are facing criticism for advising UK holidaymakers to come home from Tunisia amid fears of another terror attack.
Last month 30 Britons were killed when a gunman opened fire on tourists staying in a popular Tunisian holiday resort. IS said it carried out the attack.
Tunisia has accused the UK of playing into terrorists' hands and some tourists complained they were being ordered out of the country.
After the Tunisian beach attack, Mr Cameron said IS posed "an existential threat" to the West, and its members in Iraq and Syria were plotting "terrible attacks" on British soil and elsewhere.

It is trying to find 25 children who have shown promise to receive master classes from experts.
They will receive materials to practice at home and attend six one-day sessions.
Artists who have painted the Gwynedd landscape include Gwilym Prichard and Sir Kyffin Williams.
The Criw Celf initiative wants pupils who will be starting in year seven in Gwynedd schools in September.
Ukraine's Oleg Verniaiev won Olympic gold on the parallel bars in Rio after narrowly missing out on the all-around title.
[NEXT_CONCEPT]
Everything Everywhere, the company that runs Orange and T-Mobile in the UK has said that it will cut 1,200 jobs.
[NEXT_CONCEPT]
David Cameron has invited acting Labour leader Harriet Harman to a high-level security meeting about the threat posed by Islamic State (IS) extremists.
[NEXT_CONCEPT]
Many famous artists have captured Gwynedd's stunning scenery and now the local authority is looking for the next generation of talent.