The teams began the game in a nearly empty arena as security officials prevented fans from entering while police exploded a suspicious backpack left near a public restroom. The explosion reverberated inside and out Carioca Arena. Fans were allowed in later in the first quarter.
Rudy Fernandez added 13 points for Spain, which began the tournament with losses to Croatia and Brazil. Another loss would have put the defending silver medalists in danger of not advancing past pool play.
Spain trailed by one point entering the fourth, when they turned to Olympic veterans Gasol, Rubio and Fernandez.
Chamberlain Oguchi scored 24 and Josh Akognon 12 for Nigeria, which was within 83-82 but couldn’t come up with big plays down the stretch.