Shane Schindler, 30, will spend between eight and 30 years in jail

A man has been jailed for eight to 20 years for using a hammer to pummel a mannequin which police had set up to look like a homeless person in a bid to catch a serial killer who was murdering vagrants.

Shane Schindler, 30, was sentenced in Las Vegas on Thursday for attacking the dummy in February this year.

Police set it up in a vacant lot near where two homeless men had been bludgeoned to death in the months beforehand in a bid to catch their killer.

As part of a plea deal with prosecutors, Schindler will not face charges for those killings.

He has never admitted to either of them but confessed after his arrest that he believed the mannequin was a person when he attacked it.

Police believe Schindler was responsible for bludgeoning two sleeping homeless men to death and injuring a third.

However cops admit they have no hard evidence to prove this.

In June, he pleaded guilty to murdering an inanimate object. His lawyer told CBS that he said nothing during his sentencing hearing on Thursday.

It is not clear how or when the exact length of his sentence will be determined.

Scroll down for video

Schindler was filmed on February 22 removing his 4-lb ball peen hammer from a plastic bag (left) to strike the mannequin on the head twice (right)

The 30-year-old Michigan native wore a black hoodie and dark trousers to carry out the attack

Schindler was caught by police who were investigating the murders of Daniel Aldape and David Dunn, two homeless men who were beaten to death in January and February.

Another homeless man was assaulted months earlier and survived but did not get a glimpse of his attacker.

Suspecting a serial killer with a specific taste for homeless men, Las Vegas Police detectives laid out the dummy on February 22 and covered the back of its head to make it appear as though it were a real person.

Police swooped on him within seconds of watching the attack on surveillance cameras

They had set up the dummy to look like a sleeping homeless man beneath a blanket

Schindler's four-pound ball peen hammer was confiscated at the scene

Police said it was 'good for the community' that Schindler was off the streets

They watched on surveillance footage as Schindler, a Michigan native, approached it with a plastic bag.

He watched the dummy for several seconds then calmly removed his weapon from the bag and launched at the dummy.

After striking it twice in quick succession, he walked away slowly.

Police swooped on him seconds later and took him in to custody.

Las Vegas Metropolitan Police Captain Andrew Walsh spoke of his relief earlier this year that Schindler had taken the plea deal.

'This is good for the community, that he's taking this deal.

'He's off the streets'.