Students from the Community Arts and Media High School in Brooklyn had the opportunity to write and perform a song they created after being inspired by the Broadway musical “Hamilton.”

In the school’s basement dance studio, students rehearsed the song, which they dedicated to African-Americans who fought during the Revolutionary War.

Mahki Clemons is part of the Hamilton Education program known as EduHam. "It's not really taught about much, it's kind of pushed to the side, so talking about the African-American's contribution to the Revolutionary War is really important," Clemons said.

The program weaves Lin Manuel Miranda's acclaimed musical about Founding Father Alexander Hamilton into the studies of American history.

Some students have the opportunity to perform their own work on stage. Following the performance, EduHam provides students with $10 tickets to see a matinee showing of "Hamilton."

"We really started, like, getting serious about our project when we found out we'd be performing. We put a lot of time effort and energy into it," said student Nevaeh Nieves.

Their hard work paid off on Wednesday, when the students who performed did not throw away their shot on stage. “I loved every single moment of it. It was awesome,” Rafael Delacruz said.

The trio was one of 13 acts from New York and New Jersey schools that performed for hundreds of other EduHam students who attended the matinee.

Hamilton actor Carvens Lissaint, who plays George Washington, MC’d the student presentations.

The program is funded in part by the Gilder Lehrman Institute, which provides students with primary source documents.

The Brooklyn students' song was inspired by what they'd read about James Armistead Lafayette, a slave-turned-spy who helped the Continental Army.

"It was a really entertaining and very interesting way to put him into a song,” Delacruz said.

The program is made up of schools where at least 40% of students come from low-income homes.

Before the show began, students were treated to a question and answer session with cast members.