WASHINGTON — She has one of the most influential positions in the country, but as a girl who did not grow up privileged, Supreme Court Justice Sonia Sotomayor credits her incredible journey to one thing.

“The key to success in my life, it’s the secret that I want to share with kids and how I became successful. I’m here as a Supreme Court Justice only because of books," said Sotomayor.

The first Latina Supreme Court Justice spoke to a packed main hall of over 2,000 people at the Walter E. Washington Convention Center on Saturday at the 18th annual Library of Congress National Book Festival.

Organizers said Sotomayor is the first children’s book author invited to speak on the main stage at the festival. After the main hall filled up, several hundred more watched on monitors in the hallways.

“I wish every kid here could see that if I can do it so can you!" said Sotomayor.

"Turning Pages," a new picture book by Sonia Sotomayor. Penguin Random House

An avid reader growing up, Sotomayor’s new book for young readers, "Turning Pages: My Life Story," is a richly illustrated book that chronicles her life growing up in New York City.

“Reading books opened the world to me. Especially for children growing up in modest means as I did, books give you the chance to explore the wider world. Television and especially now the Internet don’t let you imagine," said Sotomayor.

As a young girl growing up with limited economic means, it was a chance to explore and imagine a world beyond where she was living, with endless possibilities at her fingertips as she turned the pages.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"The power of words is in creating pictures in your mind and that is very special. As a child, I explored the world through books. I saw the possibilities of things that I could have never imagined without reading," said Sotomayor. "I could have never imagined traveling to faraway places and now I do it, but that wish to meet other people and go other places came from reading. Books were the key to deciding to become what I am today.”

Supreme Court Associate Justice Sonia Sotomayor walks through the audience while talking about her children's book, "Turning Pages: My Life Story", during the Library of Congress National Book Festival in Washington on Sept. 1, 2018. Cliff Owen / AP

On the cover of "Turning Pages," the Sotomayor is walking up the steps to the U.S. Supreme Court. But at the bottom of the picture, sitting on some leaves is a little coquí — the common name for a species of small tree frog that is native to Puerto Rico and is known for its cheerful evening chirp.

“It is a symbol of Puerto Rico,” said Sotomayor, who was born and raised in New York City to a family originally from the island.

The book, which will be released Sept. 4 in both English and Spanish, is illustrated by award-winning Puerto Rican author/illustrator Lulu Delacre. She told NBC News she was trying to portray Sotomayor's work in a way that connects emotionally with children, so they see her not just as a Supreme Court Justice but as a little girl and a human being.

"She shared with me all of her family albums and I wanted to portray the memories that she had as close as to what she remembered them to be," said Delacre.

One of the illustrations shows a young Sotomayor walking with her grandmother to school. Another illustration is a copy of her library card. The neighborhood library, Sotomayor writes, was her salvation during a turbulent home life as a young girl.

“The library was my harbor and books helped me escape the sadness of home,” she writes in the book. “And that’s still the place,” she says. “Not just for quiet but also a sense of peace because there you have the key I have, the key to books.”

Delacre said she wanted the illustrations to be a reflection of who Sotomayor was.

"There are many hidden messages in the book and all of them are related to words, because words are so important for the Justice," said Delacre.

Sotomayor told the audience she dedicated her new book to “my abuelita (grandmother) Mercedes and all the women who served as role models in my life.”

Sotomayor told the packed crowd that she is currently working on another children’s book out next year that focuses on “children with differences,” based on her experience as a young girl diagnosed with diabetes.

She recalled how one time she injected herself at a restaurant shortly before having a meal and overheard another patron whisper that she must be a drug addict.

“I went up to her and said, 'Listen don’t assume. I am a diabetic and that’s why I did the injection’. And that incident gave me the idea to write about children that may ‘look’ or ‘act’ or ‘be” different, and to say that it is the differences that make us great," said Sotomayor.

Sotomayor did not address any public affairs or current event issues. But when asked how she “stays calm in these trying times” she said that her mission as a member of the U.S. Supreme Court is “civil participation."

She told the audience, “I can’t participate in politics because of my job, but you can. Get involved and do something. It’s our responsibility to make a better world,” she said to loud applause, cheers and a standing ovation.

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.