LOS ANGELES -- Arizona starting pitcher Ian Kennedy hit Los Angeles starter Zack Greinke with a pitch in the seventh inning Tuesday night, a retaliation throw that caused a prolonged bench-clearing brawl that resulted in the ejection of five players and coaches.

An inning earlier, Greinke hit Diamondbacks catcher Miguel Montero and both teams came charging onto the field but it broke up quickly with no punches were thrown. That was payback for Kennedy hitting Dodgers rookie Yasiel Puig. The ball deflected off his shoulder and struck Puig on the nose.

Kennedy then hit Greinke in the upper left shoulder with one out in the seventh and the game tied 2-2. Both benches and bullpens cleared and a fight ensued near the Diamondbacks' dugout that nearly spilled into the stands.

Kennedy, manager Kirk Gibson and coach Turner Ward were ejected for Arizona. Puig and Dodgers hitting coach Mark McGwire were also tossed.

Things got out of hand after Kennedy hit Greinke. The teams went at it, with Dodgers reliever Ronald Belisario throwing punches and Puig rushing into the melee. Ward got slammed against a railing and was put in a headlock by Dodgers left fielder Skip Schumaker, who appeared to be trying to break up the fight as both teams kept pushing closer to the stands.

McGwire had Gibson's jersey and windbreaker with both hands and was screaming at him.

Dodgers manager Don Mattingly had to be restrained as he tried to get at Gibson, then they exchanged words briefly. McGwire and third base coach Matt Williams shouted at each other.

Montero, still in full catching gear, ended up on the ground next to Ward.

Loading Slideshow...
  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Manager Don Mattingly of the Los Angeles Dodgers pushes down coach Alan Trammell #3 of the Arizona Diamondbacks during as Diamondbacks coach Matt Williams tries to restrain Mattingly a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Clayton Kershaw, Kirk Gibson, Clint Fagan

    Los Angeles Dodgers starting pitcher Clayton Kershaw, right, yells as Arizona Diamondbacks manager Kirk Gibson, left, as umpire Clint Fagan separates them after Los Angeles Dodgers' Zack Greinke was hit by a pitch during the seventh inning of their baseball game, Tuesday, June 11, 2013, in Los Angeles. (AP Photo/Mark J. Terrill)

  • A scuffle breaks out after Los Angeles Dodgers starting pitcher Zack Greinke was hit by a pitch during the seventh inning of their baseball game against the Arizona Diamondbacks, Tuesday, June 11, 2013, in Los Angeles. (AP Photo/Mark J. Terrill)

  • Don Mattingly, Manny Gonzalez, Jerry Hairston

    Los Angeles Dodgers manager Don Mattingly, center, yells at members of the Arizona Diamondbacks while umpire Manny Gonzalez holds him back as Jerry Hairston Jr. looks on after starting pitcher Zack Greinke was hit by a pitch during the seventh inning of their baseball game, Tuesday, June 11, 2013, in Los Angeles. (AP Photo/Mark J. Terrill)

  • Mark McGwire, Kirk Gibson

    Los Angeles Dodgers batting coach Mark McGwire, right, yells at Arizona Diamondbacks manager Kirk Gibson after Los Angeles Dodgers' Zack Greinke was hit by a pitch during the seventh inning of their baseball game, Tuesday, June 11, 2013, in Los Angeles. (AP Photo/Mark J. Terrill)

  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Manager Don Mattingly (R) of the Los Angeles Dodgers pushes down coach Alan Trammell #3 of the Arizona Diamondbacks during a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Batting coach Mark McGwire (R) of the Los Angeles Dodgers has words with manager Kirk Gibson of the Arizona Diamondbacks as first base umpire Brian Gorman intervenes during a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Batting coach Mark McGwire (R) of the Los Angeles Dodgers has words with manager Kirk Gibson of the Arizona Diamondbacks as first base umpire Brian Gorman intervenes during a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Batting coach Mark McGwire (R) of the Los Angeles Dodgers has words with manager Kirk Gibson of the Arizona Diamondbacks as first base umpire Brian Gorman intervenes during a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Arizona Diamondbacks v Los Angeles Dodgers

    LOS ANGELES, CA - JUNE 11: Batting coach Mark McGwire (R) of the Los Angeles Dodgers has words with manager Kirk Gibson of the Arizona Diamondbacks as first base umpire Brian Gorman intervenes during a bench clearing brawl in the seventh inning at Dodger Stadium on June 11, 2013 in Los Angeles, (Photo by Stephen Dunn/Getty Images)

  • Zack Greinke, Miguel Montero

    Los Angeles Dodgers' Zack Greinke, right, is hit by a pitch as Arizona Diamondbacks catcher Miguel Montero catches during the seventh inning of their baseball game, Tuesday, June 11, 2013, in Los Angeles. (AP Photo/Mark J. Terrill)