Harper, who had hit 10 homers in his previous 12 games and has won back-to-back NL player of the week awards, was batting with two outs in the third Wednesday night when Adam Warren's first pitch of the at-bat was called a strike by plate umpire Marvin Hudson.
Harper stepped out of the batter's box, leading to an animated back-and-forth with Hudson, who also was exchanging words with Williams, who was in the dugout.
Harper and Hudson then had more words after the umpire told the 2012 National League rookie of the year to get back in the batter's box.
"I think the whole thing was me not getting into the box. I really do," Harper said. "I didn't look at him one time and show him up."
"Had nothing to do with the box," Hudson told a pool reporter.
Hudson's interpretation of the confrontation was different than Harper's.
"He didn't like the pitch, and I let him have his say, going and coming," Hudson said. "The dugout didn't like it, and one thing led to another and I had to run him. I had to eject him."
Countered Harper: "I don't think 40,000 people came to watch him ump tonight. Plain and simple. Plain and simple. I mean, I really don't think they did. Especially when we're playing the Yankees. The Yankees are a good team, we're a good team and we're rolling. And, I mean, the way I'm hitting, I don't want to get tossed. I don't think I really did anything bad to get tossed. But maybe he just had a bad morning. Maybe he didn't get his coffee."
After Harper was tossed, Williams bolted out of the dugout, moved Harper aside and began arguing with Hudson, getting kicked out, too. Williams then went over and kicked dirt on home plate -- one swipe with each foot.
"Doggone it, he's our best player and arguably the best player on the planet right now. And we need him in the game," Williams said. "And I don't feel as if there was any need to throw him out."
Michael A. Taylorreplaced Harper for that at-bat, striking out, then took over in right field.
Information from The Associated Press was used in this report.
Harper tossed in Nationals' win
Baseball Tonight Spotlight: Bryce Harper gets ejected in the third inning for arguing strikes, but the Nationals go on to beat the Yankees 3-2.