The hats were worn prior to the game and during the singing of the National Anthem, but not during the game, as Major League Baseball officially denied the Diamondbacks’ petition to do so.

Rockies players and coaches also wore the hats during batting practice and the National Anthem.

In a moving tribute before the first pitch, a firefighters’ bagpipe band played “Amazing Grace” as photos flashed on the giant video screen of the 19 “hotshot” firefighters killed fighting the Yarnell Hill wildfire northwest of Phoenix.

That was followed by a 19-second period of silence from the sellout crowd at Chase Field.

“We do it as a tribute to the families and the people who gave their lives fighting that fire,” manager Kirk Gibson said Friday. “We were out on the road and it was tough for us, but when we heard (the news of the Yarnell fire), that was the worst feeling we had.”

In addition to the uniform add-ons, a No. 19 will be painted on the grass behind home plate to honor the lives of the 19 fallen firefighters. The same No. 19 is also on each player’s clubhouse name plate.

“Those guys are our heroes,” infielder Cliff Pennington said.

Earlier Friday, the Diamondbacks pledged to give a second matching donation of $100,000 to victims of the wildfire. Their first such donation came on Thursday, when fans’ contributions exceeded $100,000.

Those interested in donating to fire victims through the Diamondbacks can do so by visiting dbacks.com