Portugal's secretary of state for the environment has resigned after it emerged he appointed a cousin as his assistant, fueling mounting concerns over family connections in senior government posts.

Five months before a general election, opposition parties have chided the Socialist government over the family ties in its ranks. The Cabinet contains a husband and wife, as well as a father and daughter, and relatives of prominent Socialist Party members have in recent times landed plum government jobs.

Though Prime Minister Antonio Costa has insisted the appointments were all based on merit, the revelations have brought accusations of nepotism and wide public criticism on social media.

Environment secretary Carlos Martins said Thursday he was resigning because he didn't want the controversy over his cousin's appointment to damage the government.