(CNN) -- Do comedy writers share notes or do they just think alike?
On the day "Tonight Show" host Jay Leno announced he was passing the baton to Jimmy Fallon, he and an old rival shared nearly identical jokes on their late night shows.
In his opening monologue on Wednesday, Leno said it had been a tough day for him.
"Had a really awkward day today," the late night host said in mock anguish. "Had to call David Letterman and tell him he didn't get 'The Tonight Show' ... again."
At nearly the same instant on the "Late Show," Letterman addressed his rival's impending retirement.
"I got a call from my mom today, she says, 'Well, David, I see you didn't get the 'Tonight Show' again,'" Letterman said with a shrug. "What are you going to do, mom?" he asked.
A bit of comedy serendipity? Maybe it was just too tempting to pass up.
Many expected Letterman would take over "The Tonight Show" when former host Johnny Carson retired in 1992, but the gig instead went to Leno. Letterman jumped networks to start "The Late Show" on CBS, which airs opposite Leno on NBC.
Fallon bounded onto his "Late Night" set, full of energy, if a bit manic, after word of his new job.
"Hello! Welcome! This is 'Late Night with Jimmy Fallon,' for now," he said to chuckles. "You guys probably heard the news -- I'm going to be taking over 'The Tonight Show' next February!
"But don't worry, until February, our focus is right here on whatever this show is called."
Later, Fallon's voice cracked as he paused and struggled for words at times.
"I want to thank everyone here at 'Late Night.' The staff, the crew and, of course, The Roots," he said, referring to his late night band. "I have to say thanks to Jay Leno for being so gracious. It means so much to me to have his support."
An hour earlier, Leno congratulated Fallon in his opening monologue, while taking another swipe at the NBC executives that are showing him the door.
"I just have one request of Jimmy. We've all fought, kicked and scratched to get this network up to fifth place, okay? Now we have to keep it there," he deadpanned. "Jimmy don't let it slip into sixth. We're counting on you."
Leno will wrap up his 22-year run as host in spring 2014, with Fallon officially signing on as his replacement.
On his Twitter account, Fallon said, "Today was one of the most exciting days of my life."
Rumors have been swirling
The expectation that Leno would leave NBC's legendary late-night program has been building recently, and Fallon's appointment isn't surprising in the least.
He's had a swift rise to "Tonight's" chair, having hosted "Late Night" for just four years, but Fallon's transition was treated as such a near certainty that both hosts worked the headlines into their nightly routines.
While Fallon initially downplayed the rumors, Leno went after his employer on a regular basis.
He compared NBC executives to snakes, joked about the network's sagging ratings and kidded that the rumored late-night shuffle was like NBC's version of March Madness.
Just two days before the big announcement, Fallon and Leno again made light of the reports with a parody of the song "Tonight" from the musical "West Side Story."
With Leno's contract set to expire in fall 2014, industry observers said the move was only a matter of time.
And this, says media reporter Bill Carter, was the right time.
"Jay told me that really the difference with this was he went along with it," said Carter, a New York Times reporter who wrote "The War for Late Night: When Leno Went Early and Television Went Crazy" -- a book that chronicles the last time Leno left "Tonight."
"He agrees with this. He's on board with this."
This has happened before
Leno first exited "Tonight" in 2009 after 17 years as host, passing the torch to Conan O'Brien, who was then the host of "Late Night."
Leno was moved to prime time with his own program, "The Jay Leno Show," that fall.
But when that brought dismal ratings, NBC decided to put Leno back in charge of "Tonight" at the start of 2010, leaving O'Brien without a job.
Despite his short stint on "Tonight," O'Brien wished Fallon well.
"I want to congratulate Jimmy. That is a really fun gig. You laugh, but it really is," O'Brien said, trying to reassure the audience he wasn't being sarcastic. "Jimmy is the perfect guy to do it. He's going to do a fantastic job."
After getting the boot from "Tonight," the flame-haired comedian eventually moved to TBS to host his own show, "Conan," in the 11 p.m. hour, but the entire scenario generated ill will toward Leno and NBC. (TBS shares a parent company with CNN.)
Yet as the years went on, Leno has proved to be resilient.
As NBC's prime-time ratings suffered, Leno's "Tonight Show" was still able to rise above the rest in its time slot. At the end of March, "The Tonight Show" hit a seven-week high in total viewers, with 3.52 million watching.
However, NBC was said to be concerned about losing younger viewers to ABC's Jimmy Kimmel, whose "Jimmy Kimmel Live" was moved up to compete with Leno and David Letterman's "Late Show" at the beginning of 2013.
"The more time Jimmy Kimmel is in that slot, the more the young audience goes that way, the harder it is for (Fallon) to keep that audience," one source familiar with the network's thought process told The Hollywood Reporter in March.
Changing states of comedy
With the change in hosts comes a change in locales.
According to a statement from NBC, "As part of the transition, 'The Tonight Show' will be returning to its original home in 30 Rock in New York" from Leno's base of Los Angeles.
New York Gov. Andrew Cuomo praised the move, saying in a statement "on behalf of all New Yorkers" that he's "pleased to welcome 'The Tonight Show' back to its first home."
When it began in 1954, the "original 'Tonight Show' ushered in the modern era of television," Cuomo continued. "It is only fitting that as 'The Tonight Show' returns to our state, it will be headlined by New York's own native son and resident, Jimmy Fallon."
Out with the old
At 62 years old, Leno represents a more traditional form of hosting, as he's known for his "Las Vegas-style comedy," said The New York Times.
Fallon, 38, regularly incorporates the Web and social media into his act, offering "a more contemporary and varied brand of entertainment," the Times said.
This changing of the guard is one of the most closely watched exercises in pop culture, especially as it takes place at one of TV's mainstay productions.
Even with its decline in ratings over the years, it remains a solid profit center for NBC, making between $25 million and $40 million for the network, according to The New York Times.
Although it's been on the air for almost 60 years, "The Tonight Show" has had just a handful of regular hosts: Steve Allen, Jack Paar, Johnny Carson, Leno and O'Brien.
"The Tonight Show" isn't what it was during the long tenure of Carson, who hosted the show from 1962 until 1992.
In those three-network times, Carson dominated late-night TV like nobody before or since. He dominated the ratings and routinely sat down challengers like so many duck targets at a carnival shooting gallery. Joey Bishop, Dick Cavett, Joan Rivers, Pat Sajak -- they all tried to dethrone the king, and they all came up short.
Carson sat behind "Tonight's" desk for 30 years before passing the torch to Leno, and "Johnny" is still the model against whom all are measured.
"Late Night" producer Lorne Michaels, who's now executive producer of "The Tonight Show," has called Fallon "the closest thing" this generation has to Carson.
It appears it's now time for Fallon to show and prove.
CNN's Henry Hanks contributed to this report.