Lin-Manuel Miranda arrives at the 32nd annual Imagen Awards at the Beverly Wilshire Hotel on Aug. 18, 2017 in Beverly Hills, Calif.

The "Hamilton" creator and star earns his first top 40 Hot 100 hit.

Lin-Manuel Miranda's new charity single "Almost Like Praying," featuring Artists for Puerto Rico, blasts in at No. 1 on the Digital Song Sales chart dated Oct. 28, with 111,000 downloads sold in the tracking week ending Oct. 13, according to Nielsen Music.

"I'm filled with gratitude," Miranda tells Billboard. "The generosity of the American people sends a clear message to our fellow citizens and the 78 municipalities of Puerto Rico: we have not forgotten about you, we will never forget you and we will continue to be here for you."

The sales sum drives the song's debut on the Billboard Hot 100 chart (dated Oct. 28) at No. 20, marking Miranda's first top 40 hit on the ranking. The track also drew 5.2 million first-week U.S. streams.

As previously reported, Post Malone's "Rockstar," featuring 21 Savage, tops the Oct. 28-dated Hot 100. All charts will update Tuesday on Billboard.com.

Miranda previously hit the Hot 100 with two titles in 2016: "Love Make the World Go Round," with Jennifer Lopez (which reached No. 72), and "We Know the Way," with Opetaia Foa'i (No. 93), the latter song from the Disney movie Moana. The tracks reached Nos. 9 and 38, respectively, on Digital Song Sales.

Miranda has also charted on the Hot 100 as the writer of three other Moana entries, all of which peaked earlier in 2017: Auli'i Cravalho and Alessia Cara's versions of "How Far I'll Go," which reached Nos. 41 and 56, respectively, and Dwayne Johnson's "You're Welcome" (No. 65).

The composer, playwright and actor is perhaps best known as the creator and star of Hamilton, with the Broadway cast recording Hamilton: An American Musical having spent 102 weeks at No. 1 to date on the Cast Albums chart, the second-longest reign in the chart's history (after Wicked's 333-week command).

"Almost," sung primarily in Spanish, additionally completes the first set of back-to-back Latin music No. 1s on Digital Song Sales, dethroning last week's champ, J Balvin and Willy William's "Mi Gente," featuring Beyonce.

Among the Artists for Puerto Rico on "Almost" are Marc Anthony, Camila Cabello, Gloria Estefan, Luis Fonsi and Lopez. Proceeds from the song will benefit the UNIDOS Disaster Relief & Recovery Program.

Miranda penned "Almost," which contains elements of Leonard Bernstein and Stephen Sondheim's "Maria," from West Side Story. "I wrote this song the day after the hurricane hit Puerto Rico," Miranda previously told Billboard. "We realized this storm was the worst storm to hit the island in modern history and its name was Maria -- that's the name of my favorite song from West Side Story. So, I thought, how can I flip that negative connotation into something [positive] for Puerto Rico?"

Click here to learn more about how to help Puerto Rico and the Hispanic Federation's UNIDOS Disaster Relief & Recovery Program.