In the late hours of the NBA Draft, after night had ticked into morning, Nets general manager Sean Marks — looking tired but mostly satisfied — laid out his dream for free agency.

“High-character people,” he said. Players who “want to be part of this city,” he added. A player, he said, who would make people “look out there and go, ‘I want to get behind that team.’ ”

In other words: Welcome back, Linsanity. Or rather, welcome to Brook-Lin.

The Nets agreed to terms with former Knicks point guard Jeremy Lin — the Harvard product who took over the city and basically started his own fan movement in February 2012 — to a three-year, $36-million contract Friday, according to Yahoo Sports, which cited league sources. The Nets can’t confirm the signing until the NBA moratorium ends at 12:01 a.m. on Thursday, but Lin did it for them on his Twitter and Instagram.

advertisement | advertise on newsday

“The journey continues . . . thankful for the next chapter!! #Godisgood” tweeted Lin, accompanied by a photo of himself in a Nets uniform.

It seems like a natural union for the Nets, who announced the hiring of Kenny Atkinson as coach in May. Atkinson, a former point guard, was an assistant under former Knicks coach Mike D’Antoni and is heavily credited, by Lin and others, for Lin’s development.

After his introductory news conference, Atkinson highlighted the need for a capable point guard, a glaring hole last season, when they lost Jarrett Jack to injury and were forced to play Donald Sloan or Shane Larkin at the position. The Nets waived Jack on Thursday.

Though Lin, 27, hasn’t shown quite the same star power that he did in 2011-12, he’s an excellent passer and ballhandler and can get to the rim in a hurry. He bolsters a somewhat woeful backcourt and brings a marquee name to a team that had Brook Lopez . . . and that’s about it.

Lin averaged 11.7 points and 3.0 assists with the Hornets last season and declined his player option to stay with the team.

He’s shown an ability — and a desire — to play and excel in a difficult market. After opening eyes by coming off the bench to score 25 points against the Nets on Feb. 4, 2012, he scored the most points (136) by an NBA player in his first five starts since the 1976-77 merger. Including the game against the Nets, he averaged 24.6 points and 9.2 assists in a 10-game span.

In the 2011-12 season. his replica jersey ranked ahead of Kobe Bryant and LeBron James and was second only to Derrick Rose in sales at the NBA Store in Manhattan and on NBAShop.com.

Before playing for the Knicks, Lin came off the bench for the Golden State Warriors. After his Knicks tenure, he made stops with the Rockets and Lakers before getting traded to the Hornets. He hasn’t been an everyday starter since the 2012-2013 season, when he started all 82 games, but it seems likely that will change with the Nets.

After all, he’s exactly what they were looking for.

“We’re starting to build a new culture here and we want to do it with the right people,” Marks said that night, possibly already envisioning Lin. “We’ll get the right people. We’ll get the people that want to come here . . . The players that come here, they’re going to want to be part of this city. They’re going to fight for it. They’re going to have that passion, the same I would, the same way Kenny will.”