The three District of Columbia students could not believe the news. They had developed a method to purify lead-contaminated water in school drinking fountains and Nasa announced last month that they were finalists in the agency’s prestigious high school competition – the only all black, female team to make it that far.

“Hidden figures in the making,” one of the teenagers wrote in a celebratory text message to her teammates and coaches, a reference to the 2016 movie about the true story of three African-American women who worked for Nasa in the 1960s.

The next stage of the science competition included public voting and the Banneker High School students – Mikayla Sharrieff, India Skinner and Bria Snell, all 17-year-old high school juniors – turned to social media to promote their project.

But, while the teenagers were gaining traction on social media and racking up votes, users on 4chan – an anonymous internet forum where users are known to push hoaxes and spew racist and homophobic comments – were trying to ensure the students would not win.

The anonymous posters used racial epithets, argued that the students’ project did not deserve to be a finalist and said the black community was voting for the teenagers only because of their race. They urged people to vote against the Banneker trio and one user offered to put the topic on an internet thread about president Donald Trump to garner more attention. They recommended computer programs that would hack the voting system to give a team of teenage boys a boost.

Nasa said in a statement that voting was compromised, prompting it to shut down public voting earlier than expected. The federal space agency said it encourages the use of social media to build support for projects but wrote in a statement on Tuesday that public voting was ended because people “attempted to change the vote totals”.

“Unfortunately, it was brought to Nasa’s attention yesterday that some members of the public used social media, not to encourage students ... but to attack a particular student team based on their race and encourage others to disrupt the contest and manipulate the vote and the attempt to manipulate the vote occurred shortly after those posts,” the Nasa statement read.

“Nasa continues to support outreach and education for all Americans and encourages all of our children to reach for the stars.”

The federal agency named eight finalists and said it will announce the winners this month. In addition to the public voting, judges assess the projects to determine the winners, who are invited to Nasa’s Goddard Space Flight Centre in Greenbelt, Maryland, for two days of workshops, with the winning team receiving a $4,000 (£2,950) stipend to cover expenses.

Sharrieff, Skinner and Snell did not talk about the controversies tainting the voting, but said in interviews on Tuesday that they are excited about the positive attention their project has received from classmates, the Washington, DC community and even strangers on social media.

Prominent black activists and organisations, including one of the leaders of the Women’s March, helped spread the word about the competition, saying black women are underrepresented in science and that the public should help propel the Banneker students to the top of the competition.

One of Sharrieff’s tweets urging her followers to vote for the project was retweeted more than 2,000 times. And someone even set up an online fundraiser for college scholarships for the teenagers.

“In the STEM field, we are underrepresented,” Sharrieff said, referring to the widely used acronym for the science, technology, engineering and math fields. “It’s important to be role models for a younger generation who want to be in the STEM field, but don’t think they can.”

Science news in pictures Show all 20 1 /20 Science news in pictures Science news in pictures Pluto has 'beating heart' of frozen nitrogen Pluto has a 'beating heart' of frozen nitrogen that is doing strange things to its surface, Nasa has found. The mysterious core seems to be the cause of features on its surface that have fascinated scientists since they were spotted by Nasa's New Horizons mission. "Before New Horizons, everyone thought Pluto was going to be a netball - completely flat, almost no diversity," said Tanguy Bertrand, an astrophysicist and planetary scientist at NASA's Ames Research Center and the lead author on the new study. "But it's completely different. It has a lot of different landscapes and we are trying to understand what's going on there." Getty Science news in pictures Over 400 species discovered this year by Natural History Museum The ancient invertabrate worm-like species rhenopyrgus viviani (pictured) is one of over 400 species previously unknown to science that were discovered by experts at the Natural History Museum this year PA Science news in pictures Jackdaws can identify 'dangerous' humans Jackdaws can identify “dangerous” humans from listening to each other’s warning calls, scientists say. The highly social birds will also remember that person if they come near their nests again, according to researchers from the University of Exeter. In the study, a person unknown to the wild jackdaws approached their nest. At the same time scientists played a recording of a warning call (threatening) or “contact calls” (non-threatening). The next time jackdaws saw this same person, the birds that had previously heard the warning call were defensive and returned to their nests more than twice as quickly on average. Getty Science news in pictures Turtle embryos influence sex by shaking The sex of the turtle is determined by the temperatures at which they are incubated. Warm temperatures favour females. But by wiggling around the egg, embryos can find the “Goldilocks Zone” which means they are able to shield themselves against extreme thermal conditions and produce a balanced sex ratio, according to the new study published in Current Biology journal Ye et al/Current Biology Science news in pictures Elephant poaching rates drop in Africa African elephant poaching rates have dropped by 60 per cent in six years, an international study has found. It is thought the decline could be associated with the ivory trade ban introduced in China in 2017. Reuters Science news in pictures Ancient four-legged whale discovered in Peru Scientists have identified a four-legged creature with webbed feet to be an ancestor of the whale. Fossils unearthed in Peru have led scientists to conclude that the enormous creatures that traverse the planet’s oceans today are descended from small hoofed ancestors that lived in south Asia 50 million years ago A. Gennari Science news in pictures Animal with transient anus discovered A scientist has stumbled upon a creature with a “transient anus” that appears only when it is needed, before vanishing completely. Dr Sidney Tamm of the Marine Biological Laboratory could not initially find any trace of an anus on the species. However, as the animal gets full, a pore opens up to dispose of waste Steven G Johnson Science news in pictures Giant bee spotted Feared extinct, the Wallace's Giant bee has been spotted for the first time in nearly 40 years. An international team of conservationists spotted the bee, that is four times the size of a typical honeybee, on an expedition to a group of Indonesian Islands Clay Bolt Science news in pictures New mammal species found inside crocodile Fossilised bones digested by crocodiles have revealed the existence of three new mammal species that roamed the Cayman Islands 300 years ago. The bones belonged to two large rodent species and a small shrew-like animal New Mexico Museum of Natural History Science news in pictures Fabric that changes according to temperature created Scientists at the University of Maryland have created a fabric that adapts to heat, expanding to allow more heat to escape the body when warm and compacting to retain more heat when cold Faye Levine, University of Maryland Science news in pictures Baby mice tears could be used in pest control A study from the University of Tokyo has found that the tears of baby mice cause female mice to be less interested in the sexual advances of males Getty Science news in pictures Final warning to limit "climate catastrophe" The Intergovernmental Panel on Climate Change has issued a report which projects the impact of a rise in global temperatures of 1.5 degrees Celsius and warns against a higher increase Getty Science news in pictures Nobel prize for evolution chemists The nobel prize for chemistry has been awarded to three chemists working with evolution. Frances Smith is being awarded the prize for her work on directing the evolution of enzymes, while Gregory Winter and George Smith take the prize for their work on phage display of peptides and antibodies Getty/AFP Science news in pictures Nobel prize for laser physicists The nobel prize for physics has been awarded to three physicists working with lasers. Arthur Ashkin (L) was awarded for his "optical tweezers" which use lasers to grab particles, atoms, viruses and other living cells. Donna Strickland and Gérard Mourou were jointly awarded the prize for developing chirped-pulse amplification of lasers Reuters/AP Science news in pictures Discovery of a new species of dinosaur The Ledumahadi Mafube roamed around 200 million years ago in what is now South Africa. Recently discovered by a team of international scientists, it was the largest land animal of its time, weighing 12 tons and standing at 13 feet. In Sesotho, the South African language of the region in which the dinosaur was discovered, its name means "a giant thunderclap at dawn" Viktor Radermacher / SWNS Science news in pictures Birth of a planet Scientists have witnessed the birth of a planet for the first time ever. This spectacular image from the SPHERE instrument on ESO's Very Large Telescope is the first clear image of a planet caught in the very act of formation around the dwarf star PDS 70. The planet stands clearly out, visible as a bright point to the right of the center of the image, which is blacked out by the coronagraph mask used to block the blinding light of the central star. ESO/A. Müller et al Science news in pictures New human organ discovered that was previously missed by scientists Layers long thought to be dense, connective tissue are actually a series of fluid-filled compartments researchers have termed the “interstitium”. These compartments are found beneath the skin, as well as lining the gut, lungs, blood vessels and muscles, and join together to form a network supported by a mesh of strong, flexible proteins Getty Science news in pictures Previously unknown society lived in Amazon rainforest before Europeans arrived, say archaeologists Working in the Brazilian state of Mato Grosso, a team led by archaeologists at the University of Exeter unearthed hundreds of villages hidden in the depths of the rainforest. These excavations included evidence of fortifications and mysterious earthworks called geoglyphs José Iriarte Science news in pictures One in 10 people have traces of cocaine or heroin on fingerprints, study finds More than one in 10 people were found to have traces of class A drugs on their fingers by scientists developing a new fingerprint-based drug test. Using sensitive analysis of the chemical composition of sweat, researchers were able to tell the difference between those who had been directly exposed to heroin and cocaine, and those who had encountered it indirectly. Getty Science news in pictures Nasa releases stunning images of Jupiter's great red spot The storm bigger than the Earth, has been swhirling for 350 years. The image's colours have been enhanced after it was sent back to Earth. Pictures by: Tom Momary

The Nasa competition called on students to find creative ways to use space technology in their everyday lives. The teenagers said they considered dozens of ideas, but settled on a water purification system because they noticed some water fountains in their school could not be used because of potential lead contamination.

They worked at the Inclusive Innovation Incubator – a technology lab focused on diversity and entrepreneurship near Howard University – where they volunteer and their mentor at the incubator encouraged them to compete and supervised them on weekends as they built a prototype.

The teenagers purchased two jars, placing meters in each to test the purity of the water. In one jar, the teenagers place shards of copper in the water – with the copper acting as the experimental contaminant. An electric fan spins the water while filtering floss – a type of fibre – collects contaminated particles. Once clean, the water is transferred by a straw into the second jar. The meters verify that the water is clean and the teenagers said they trust their system so much, they drank the water.

The filtration system is based on Nasa technology used to develop automatic pool purifiers.

“Ours actually shows you that the water you are drinking is clean,” Snell said.

Sharrieff, Snell and Skinner, who are all on the cheerleading team, said they plan to go to college and pursue careers rooted in science.

Skinner wants to be a paediatric surgeon, Sharrieff aims to be a biomedical engineer and Snell hopes to be an anaesthesiologist.

“The popular norm is sports and modelling and advertising,” Skinner said. “And for people to see our faces and see we’re just regular girls and we want to be scientists.”