The morphological transition in ultrathin palladium (Pd) films around the percolation threshold and the related transition in hydrogen sensing behavior is investigated.We find that besides the transition from continuous to discontinuous Pd, an intermediate - semicontinuous-state must be considered. It shows hydrogen sensing features of both continuous and discontinuous film types, simultaneously. This study focuses on the discontinuous-semicontinuous transition. Experimental evidence is supported by studying the evolution of the electrical resistance with temperature, under hydrogen exposure and after thermal annealing. The results are highly relevant for the optimization of nanogap based hydrogen sensors.