B737-800
Flight Crew Multiengine; Flight Crew Instrument; Flight Crew Air Transport Pilot (ATP)
Workload; Troubleshooting
Aircraft Equipment Problem Less Severe; Deviation / Discrepancy - Procedural Published Material / Policy; Deviation / Discrepancy - Procedural Clearance; Flight Deck / Cabin / Aircraft Event Smoke / Fire / Fumes / Odor
Air Traffic Control Provided Assistance; Flight Crew Diverted; Flight Crew Requested ATC Assistance / Clarification; General Maintenance Action; General Flight Cancelled / Delayed
Aircraft
En route to ZZZ1 at around level off of cruise altitude; the F/As (Flight Attendants) called to report an electrical fumes smell around row 4. They said they would search the overhead bins and surrounding area and call back. When they called back after maybe five minutes; they couldn't see any smoke but could still smell the electrical fumes smell and a few of the passengers were complaining of the smell as well. They felt the smell was dissipating but they weren't sure. I notified Dispatch that we were going to divert for precautionary measures and ZZZ2 was ahead of us a little less than 20 minutes out. We [requested priority handling] and landed in ZZZ2 with no further event.
Reaching cruise altitude we received a call from the Flight Attendants reporting that they and some of passengers could smell an electrical burning odor in the cabin around rows 4 and 5.  The Flight Attendants searched the overhead bins and the cabin; but were unable to locate the source of the odor.  They did report it dissipated for a short while before smelling it again.  After consultation with Dispatch and Maintenance; we elected to divert to ZZZ2 as it was about 20 minutes directly in front of us.  At that point the Captain briefed the Flight Attendants and we prepared for landing in ZZZ2.  We did elect to [request priority handling] and requested [support] personnel follow us to the gate once on the ground.  At the gate we deplaned normally and the [support] personnel searched the aircraft; however; they were unable to determine a source of the odor.
Air carrier flight crew reported a fume event during cruise that was detected by flight attendants and passengers.