John F. Kennedy may have been Boston-born and DC-based, but his love affair with New York City is the stuff of legends. Here’s a look at JFK's love affair with New York City. John F. Kennedy sits atop a car with his wife Jackie, waving during a ticker tape parade up Broadway in 1960.John F. Burns/New York Times Co./Getty Images

He may have been Boston-born and DC-based, but his love affair with New York City is the stuff of legends.

Long before Marilyn Monroe’s sultry “Happy Birthday” serenade to him at a star-studded Madison Square Garden celebration in 1962, John F. Kennedy made New York the center of his personal life and political agenda.

The charismatic politician’s connection to the city is captured in hundreds of historical photos — from Caroline’s baptism by Boston Archbishop Richard Cushing at St. Patrick’s Cathedral in 1957 to Kennedy’s triumphant ride with wife Jackie through Broadway’s “Canyon of Heroes” in a ticker-tape parade toasting his 1960 presidential primary win.

Kennedy was 10 years old when his father moved the clan from Boston to Riverdale in 1927. The family then headed to tony Bronxville two years later.

By 1953, when the then-Boston senator wed New York native Jacqueline Bouvier, Kennedy’s Manhattan base was a suite on the 34th floor of The Carlyle hotel — which would become known as “the New York White House.”

Kennedy, according to legend, would use the hotel’s warren of underground tunnels to sneak his girlfriends — including Monroe — in and out to avoid detection, leading former bellman Michael O’Connell to famously quip, “Kennedy knew more about the tunnels than I did.”

John F. Kennedy leaves the Hotel Carlyle.Louis Liotta

Longtime Kennedy mistress Mimi Alford has said her last rendezvous with the president was at The Carlyle on Nov. 15, 1963, just seven days before his Dallas assassination.

Years earlier, in 1954, when he needed major back surgery, JFK chose New York’s Hospital for Special Surgery on East 42nd Street. He could be seen hobbling to and from appointments on crutches, with his wife by his side.

In 1957, the couple’s daughter, Caroline, was born at New York’s Lying-In Hospital on Second Avenue.

Shortly after his re-election to the Senate in 1958, Kennedy began laying the groundwork for his White House run — from New York.

He and brother Bobby set up a presidential campaign office on two floors of a building at 277 Park Ave.

Patriarch Joe Kennedy, who held the checkbook, worked on his son’s behalf out of a suite at The Waldorf-Astoria, with other operatives toiling from the nearby Biltmore.

JFK knew the Waldorf well — it’s where he partied at such events as the “April in Paris” ball with Jackie and sister Eunice Kennedy Shriver in 1957.

He also attended a Democratic Party fete for former First Lady Eleanor Roosevelt, joining ex-President Harry Truman and Minnesota Sen. Hubert Humphrey, among others, in 1959.

Kennedy appeared on Jack Paar’s “Tonight Show’’ in Manhattan in 1959 and — after officially announcing his candidacy in January 1960 — blitzed the city in a bid to capture New York state’s crucial 45 electoral votes.

Kennedy appeared on Jack Paar’s “Tonight Show’’ in 1959.AP Photo

He hit the usual campaign-trail events, including showing up at the annual Alfred E. Smith memorial dinner in October 1960.

There, both he and Republican rival Richard Nixon pressed the flesh with such local religious dignitaries as Francis Cardinal Spellman, looking to woo potential new powerful backers and cement the support of old allies.

A tireless campaigner, JFK charmed voters from Harlem to the Battery and from the Hudson River to the Upper East Side, shaking hands at rallies and giving speeches that drew thousands.

Kennedy conducted two of his four history-making TV debates with Nixon from Manhattan, celebrating afterward with campaign workers at The Carlyle.

1960 presidential candidates John F. Kennedy and Richard M. Nixon participate in a debate in New York.AP Photo

By mid-October, he and Jackie were riding on the back of a convertible through a blizzard of ticker tape on Broadway, as a massive crowd cheered for him as the Democratic choice for the presidential run.

Three weeks later, on Election Day, Kennedy took New York with 53 percent of the vote to Nixon’s 47.

One of JFK’s most memorable city events afterward was his birthday fund-raiser bash in May 1962, when Monroe sang to him in a body-hugging sequined dress.

The two later famously gathered with Bobby and other pals at the home of movie exec Arthur Krim.

Marilyn Monroe stands between Robert Kennedy (left) and John F. Kennedy in May 1962 in New York.Cecil Stoughton/Time Life Pictures/Getty Images