The riverboat had left the city of Iquitos on Wednesday with around 30 tourists on board to see towns along the river, local media reported.
When the boat anchored in the middle of the river for one stop, the gunmen boarded it and stole goods worth around $20,000 (Â£15,000).
None of the tourists, most of them American, were hurt.
The robbery happened early in the morning.
The gunmen arrived on a small boat and boarded the riverboat, threatening the crew and tourists with small calibre weapons.
The boat's captain was hit with a pistol handle but was not seriously injured. None of the rest of the crew were hurt.
The police arrived soon after the incident and all the tourists were evacuated to a safe location.

A letter has been sent to all 45 elected members setting out Market Abuse Regulations.
They have been asked to sign the letter acknowledging the terms and return it to the authority's legal department.
It comes after the council became the first in Scotland to issue bonds on the stock exchange worth £370m.
That followed credit rating agency Moody's assigning Aberdeen an Aa2 rating.
It will be used to fund infrastructure projects including the new Aberdeen Exhibition and Conference Centre (AECC) and the City Centre Masterplan.
The local authority said the bonds were less expensive than other available loans.
BBC Scotland understands that some councillors were initially concerned about the terms of the letter and whether it would impact on their ability to raise concerns publicly about the council's finances.
Insider dealing - where a person uses inside financial information to their benefit - is a criminal offence and is punishable by a heavy fine or imprisonment.
Market abuse is when someone can be given an unlimited fine for disclosing financial information that might affect the value of bonds and investments.
As well as councillors, senior officials at Aberdeen City Council are also included in the insiders list that must be disclosed to the Financial Conduct Authority on request.
An Aberdeen City Council spokesperson said: "Aberdeen City Council successfully issued bonds on the London Stock Exchange in 2016 and as a result must comply with the Market Abuse Regulations.
"In line with these regulations, the council is obliged to keep a list of those individuals who have access to inside information.
"Elected members and staff who have been identified as having access to inside information relating to Aberdeen City Council have been notified in writing and asked to acknowledge receipt of that letter, which contains further detail of the insider list and its purpose.
"Training sessions on the Bond and compliance with associated regulations are under way for elected members and staff, underlining the responsibilities of the organisation and individuals. It should be stressed that the requirements for confidentiality in relation to specific subjects and issues are in line with the existing terms of employment and Councillors' Code of Conduct.
"The Bond issue was the subject of several reports to full Council in 2016, which outlined the implications of the public listing on the London Stock Exchange and made it clear it was highly likely all elected members would be on the Aberdeen City Council Insider List. These reports were considered and recommendations approved by elected members during full Council prior to the Bond issue."
The council said that so far no one had refused to sign the letter, and councillors have been given until Friday to respond.
Currently all of Scotland's councillors are governed by a code of conduct.
In extreme cases, a councillor can be disqualified from office for five years for any breach.
Aberdeen City Councillors now face a potential police investigation if they are suspected of breaching Market Abuse Regulations.
Eight masked gunmen in Peru have robbed tourists enjoying a luxury riverboat cruise on the Amazon.
[NEXT_CONCEPT]
Aberdeen councillors are being warned they face prison or fines if they break London Stock Exchange laws on insider dealing, BBC Scotland has learned.