On 9 February 2017, Kygo posted a snippet of his collaboration with American singer Selena Gomez. They confirmed the single titled "It Ain't Me", via their social media accounts on 13 February. It was released on 16 February. The song is the lead single from Kygo's first EP, Stargazing. It was a certified hit and it streamed over 1 billion times on Spotify and 710 million times on YouTube, making it first and only song by Kygo till date having over a billion streams on Spotify. In addition to reaching number one in Croatia, Lebanon, and Norway, the song attained top five peaks in Australia, Austria, Belgium, Canada, the Czech Republic, Denmark, Finland, France, Germany, Greece, Hungary, Ireland, the Netherlands, New Zealand, Poland, Portugal, Scotland, Slovakia, Sweden and Switzerland. It also reached the top 10 in Italy, Spain, the United Kingdom and the United States. On 28 April, Kygo released the second single from the EP, "First Time", with English singer Ellie Goulding. This track was certified gold in UK on 20th February 2020 selling over 400,000 copies.
On 15 September 2017, Kygo remixed the U2 song "You're The Best Thing About Me", which was also released as his collaborative single with the band.
On 19 October 2017, Kygo announced via Facebook that his second studio album is called Kids in Love, which was released on 3 November. On 20 October, he released the lead single and title track "Kids in Love", which features The Night Game. Shortly after releasing the album, Kygo announced the Kids in Love Tour. On 16 March 2018, Kygo released "Remind Me to Forget", a track featuring American singer Miguel, as the third single from the album, which streamed 400 million times on Spotify as of 2 January 2020, following "Stranger Things" featuring the American pop rock band OneRepublic. "Stranger Things" received a remix from Alan Walker.