Image copyright Thinkstock Image caption Councils run schools, libraries, waste services and maintain roads, among other services

A year after the assembly election and the EU referendum, Wales returns to the polls again in the first ballot box test for the parties since the Brexit vote.

On 4 May council candidates will face the electorate. A total of 1,161 seats are up for grabs in Wales' 22 county and county borough councils.

It will be the first of two elections this year, with voters returning on 8 June for the early general election.

Could Labour's low UK opinion poll ratings mean the party will take a big hit at council level?

And might the general election campaign mean that the local government elections will serve as an early indication of what is coming down the road for the Westminster parties?

Where the parties stand

Image caption Carwyn Jones has warned that the local election campaign will be tough for Labour

Labour is the party with the most council seats in Wales - 580 - and therefore it has the most to lose.

It did well at the last local elections in 2012, adding 231 seats to its previous total. Labour is standing 944 candidates in Wales.

First Minister Carwyn Jones has already warned that the elections will be tough for the party, in what appeared to be an effort to manage expectations.

Labour currently has a majority on ten councils across south Wales - stretching from Swansea to Newport - and also leads the Vale of Glamorgan and Flintshire as the largest group.

But some Labour activists fear it could lose its grip in areas such as Blaenau Gwent, where the party had a scare in the 2016 assembly election.

And could Bridgend - Mr Jones's local council - slip into no overall control if the Tories gain seats and cut into Labour's majority?

If they have a really bad night, could Labour see numbers fall in north Wales?

Image caption Leanne Wood launched her party's local election campaign in March

Plaid Cymru has the second highest number of councillors at 170. A total of 577 of its activists are standing for council seats in May.

It had a bad night in 2012 when the party lost a council leader amid the Labour revival.

The party - which has a majority on Gwynedd council - will also be aiming to take overall control of Carmarthenshire and Ceredigion, both of which it runs as a minority administration.

Plaid will also be looking for gains in the south Wales valleys.

The party will not discuss targets publicly, but there is potential for the party to do well in Rhondda Cynon Taf - where leader Leanne Wood won a seat at the assembly election last year.

Plaid will also work hard to get a majority on the Isle of Anglesey, where it is currently short by just four.

And could the party rebuild its councillor base in Caerphilly - an authority it has previously led?

Image caption Can Andrew RT Davies' Welsh Conservatives make in-roads?

The Conservatives currently stand in third place with 104 seats, and will be hoping to benefit from Theresa May riding high in the polls. 630 candidates are standing for the party.

The party - which runs Monmouthshire with Lib Dem support - could also do well in Swansea and in the Vale of Glamorgan, the local council of both Welsh Secretary Alun Cairns and Welsh Conservative leader Andrew RT Davies.

Any gains might mostly be at the expense of Labour.

Newport was led by the Tories as a minority administration with the Liberal Democrats from 2008 to 2012, and the Conservatives undoubtedly think they can take a step forward in the city again.

Image caption The Welsh Liberal Democrats are led by their one MP, Mark Williams

The 2012 election left the Welsh Liberal Democrats the biggest losers - the party lost 66 seats. It has 75 seats to defend in May, and is standing a total of 280 candidates.

Being on the losing side of the referendum has re-energised party activists, and they will be hoping to make gains in Cardiff, where the party had an MP in the constituency of Cardiff Central until 2015.

The Lib Dems lost their leadership of Cardiff - which voted Remain at the EU referendum - at the last local election.

And could the party make gains in Swansea?

It will surprise many how large the independent presence is at local council level. Independents are defending a large number of seats - 325.

They are a significant presence at Flintshire, Ceredigion, Wrexham, Powys, Denbighshire, Conwy, Carmarthenshire, Ynys Mon, Pembrokeshire, Monmouthshire and Gwynedd.

More than 870 people are standing as independents or others in the elections.

Image copyright Getty Images Image caption Can UKIP's leader in the assembly Neil Hamilton help the party win seats at council level?

And then there's UKIP. Its first AMs were elected in 2016, but its big issue is organisation on a local level. The former Welsh chair of the party, Chris Smart, has claimed the party is unravelling.

With no councillors in Wales currently, any seats won would be a boost. It is standing 80 candidates.

If there is a natural home for UKIP in Wales, it may be the south east, where the party will want to capitalise on its strong showing at the general and assembly elections in Labour stamping grounds like Torfaen and Newport.

And what about the Greens?

The party is standing 78 candidates in the election and is defending one seat, in Gwynedd.

Its largest cohort of candidates are standing in Powys, where 17 of its activists are in the running.

There will not be council elections in every ward, however. A total of 92 of Wales' 1,254 seats will be uncontested, with candidates effectively elected because they do not face competition.

One ward, in Powys, has had no candidates nominated at all.

What about Brexit and the general election?

Image caption Wales voted Leave in the EU referendum

Council polls are coming just over a month before the snap general election, announced by Theresa May earlier in April.

Any simultaneous Westminster campaign was always going to overshadow the local election campaign - bringing negotiations to leave the EU even more to the fore than they were already.

The question is whether voters will make 4 May a preview for the June election.

Or will those who decide to vote at the council elections separate the campaigns in their minds, and vote differently?

The Conservatives are arguing that the Brexit talks need the political stability that the party says only it can offer.

Could this help the Tories make gains at authorities based in Labour heartlands?

Labour has tried to move the general election focus to public services in England, while both the Lib Dems and Plaid Cymru are hoping to rally voters around their pro-Remain views.

But could the pro-EU stance of Plaid, which has pushed for years to expand in the south Wales valleys, damage its standing in areas that voted heavily for Leave?

The same question will be asked of Labour, which is defending its running of councils in such areas.

How will the result be declared

Image copyright Getty Images Image caption Not all councils will have fully declared by early Friday morning

Most but not all councils count overnight. Nine out of the 22 will not start full counts until the next day.

Overnight counts:

Merthyr Tydfil

Blaenau Gwent

Flintshire

Wrexham

Monmouthshire

Bridgend

Neath Port Talbot

Swansea

Ceredigion

Torfaen

Newport

Cardiff

Vale of Glamorgan

Friday counts:

Caerphilly

Denbighshire

Conwy

Carmarthenshire

Rhondda Cynon Taf

Powys

Isle of Anglesey

Pembrokeshire

Gwynedd

How will the election work and what do councils do?

Image caption Ballot papers are simpler in council elections than those for the assembly

While laws are made at Westminster and the Welsh Assembly, councils operate services at a local level.

They do not run everything, but what they do run includes:

waste services

schools

social care

libraries

housing services

planning

They also set rates of council tax.

Unlike the assembly election, all councillors are elected on a first-past-the-post basis.

Voters in multi-member wards, though, have the chance to select more than one councillor.