It happened this afternoon in the Shanlea Drive area of Larne, Co Antrim.
Chief Inspector Stephen McCauley, police commander for Larne, said: “Our officers were called to the area following an attack on a man at around 12:40pm this afternoon.
“The man is reported to have been beaten with baseball bats and sustained serious head injuries as a result. The man, aged in his 20s, has been taken to hospital for treatment. At this point in time, his injuries are not thought to be life threatening.
“Police officers arrested two men in the Larne area around one hour after the attack was reported. Both men were arrested on suspicion of attempted murder and are being questioned by detectives at present.
“Anyone with information on the matter is asked to call detectives on the non-emergency 101 number.
“Or, if someone would prefer to provide information without giving their details, they can contact the independent charity Crimestoppers and speak to them anonymously on 0800 555 111.