Jimmy Kimmel and Matt Damon recently tried to work through their issues on a fake episode of “Maury.” (Randy HolmesABC)

At the Academy Awards Sunday night, host Jimmy Kimmel paid tribute to his favorite prank target: Matt Damon. In a sketch, Kimmel screened Damon’s 2011 family-friendly movie “We Bought a Zoo,” marveling that Damon “has almost no discernible talent, but he works.”

Back in the Dolby Theatre, Damon joined his childhood friend Ben Affleck on stage to present the award for best original screenplay. But the announcer told the audience to welcome “two-time Academy Award-winner Ben Affleck and guest.”

This was a continuation of a longstanding but completely fake feud between Damon and Kimmel, who eventually schemed to play his frenemy off of the stage. “I’m just presenting. You can’t play me off!” Damon said as the camera flashed to Kimmel gleefully conducting the orchestra. The constant bickering was one of the highlights of the broadcast — before all of the drama of the ceremony was usurped by an epic best picture mix-up.

Just how far back does this fake fight go? As it turns out, quite a ways. In 2011, Damon explained the origins of the joke to Parade. He wasn’t even in on it initially. In fact, he had no idea what was going on. All he knew was that Kimmel had been saying, “My apologies to Matt Damon, we ran out of time” for the better part of a year. In 2006, when Damon was finally invited to be a guest on “Jimmy Kimmel Live,” he asked the host about the gag. Here’s Damon explaining their offscreen conversation:

And he was like, “You want to know what happened? I was doing a particularly lame show; I think my guests were a ventriloquist and a guy in a monkey suit. We were wrapping it up, and there was a smattering of applause in the audience. I was having kind of a low moment, and I just said, ‘My apologies to Matt Damon; we ran out of time.’ My producer was right off camera and he doubled over laughing. It was just gallows humor. Nobody else got the joke. But it made us laugh, so we started doing it every night. I have no idea why I said you; it could have been anybody.”

On that fateful evening in 2006, Kimmel welcomed Damon with a drawn-out introduction that left little room for an actual interview. “Matt Damon, everybody!” he eventually said as the audience cheered. “They love you and it’s so good to have you here. Unfortunately, we are totally out of time.”

“I’m sorry, Matt,” he added. “Can you come back tomorrow night?”

“Go f— yourself,” Damon replied. The two then staged a screaming match, with Damon marching off the set.

The faux feud took a heightened turn in 2008 when Kimmel hosted then-girlfriend Sarah Silverman on his show. After a long, convoluted intro that included discussion of her thick, black arm hair, Silverman revealed that she had a surprise. She threw to a clip of her half-heartedly strumming a guitar.

“Here it goes,” Silverman said, before breaking into joyous song. “I’m f—ing Matt Damon!”

Then Damon appeared. “She’s f—ing Matt Damon!” he said with a wide grin. They proceeded to tell Kimmel, through song, about all the places and instances in which they did the deed. The video is, uh, really something to behold. Especially just after the 4:00 mark.

In one episode in 2013, Damon took over “Jimmy Kimmel Live.” The real host, taped to a chair with his tie in his mouth, looked on helplessly as Damon introduced himself as “the opposite of Jimmy Kimmel” and welcomed Silverman, no longer dating Kimmel, to the show. “I was wondering if you could just describe your relationship with Jimmy for me,” he said. Silverman sighed before comparing poor Kimmel to the hot dogs sold on the side of New York City streets.

Two years later, the feud had gotten so bad (read: viral) that Kimmel and Damon tried couples therapy. (Spoiler alert: It didn’t work.)

As he was on Oscar night, Affleck is often in on the joke. Last year, he went to extremes to bring Damon onto “Jimmy Kimmel Live,” carrying him in under a very large trench coat.

And just a few weeks ago, Damon appeared in a sketch with Kimmel and his wife, Molly McNearney, who is expecting their second child. The joke here was that the baby might actually be Damon’s child. Damon and Kimmel tried to hash things out on a spoof episode of “Maury,” with Martin Short playing the daytime talk show host, who has an affinity for paternity tests.

Last week, Kimmel appeared on “Ellen,” where he talked about getting ready to host the Oscars. Ellen Degeneres couldn’t help but bring up Damon, who had visited the show a week earlier and lamented that Kimmel’s Oscar hosting gig was “horrible for everybody.”

“Was he in this chair?” Kimmel asked. “Ugh.” Degeneres assured him that the chair had since been wiped down.

“We don’t like each other, in case you don’t know the back story,” Kimmel said.

The good news is: now you do.

In an unprecedented gaffe, "La La Land" was accidentally awarded the Oscar for best picture before producers realized the award actually belonged to "Moonlight." Here's how the moment played out, plus other highlights from the 2017 Academy Awards. (Nicki DeMarco/The Washington Post)

Related:

The minute-by-minute breakdown of the shocking ‘Moonlight’/‘La La Land’ best picture mix-up

‘I am alive and well’: Oscar night’s overlooked foul-up

Oscars 2017: 10 things you need to know, from the epic mix-up to Viola Davis’s speech

‘La La Land’ producer Jordan Horowitz is the truth-teller we need right now

Reactions to Oscars flub: Disbelief, Steve Harvey jokes and election night metaphors

‘There’s been a mistake. ‘Moonlight,’ you guys won.’: An Oscars shocker, in more ways than one

Oscars 2017: ‘Moonlight’s’ moment not eclipsed by Oscars mix-up

Oscars 2017 review: From Blah-Blah Land to wait — what just happened?

The most eye-catching red carpet look at the Oscars wasn’t a dress. It was a blue ACLU ribbon.

Red carpet: What celebrities wore to the Oscars

Jimmy Kimmel’s most biting monologue jokes

The Oscars’ most political moments