What role does 的 play in the sentence 我不明白你刚说的第一句话? I take 我不明白你刚说的第一句话 to mean

"I don't understand what you said in the first line"

I'm trying to understand what 的 does in this sentence (or grammar function).
Relatedly, would it be possible to omit it and still have a well formulated sentence?

Thanks in advance!
A completely parallel English version of the Chinese would be:

I didn't (or don't) understand the first word (or sentence) that you just said.

的 is functionally equivalent here to 'that':

the first word (or sentence) | that | you just said.
你刚说 | 的 | 第一句话

Notice that the order of the clause is reversed in Chinese and English.  This is because Chinese treats "the first word" as the head of the phrase, and puts it where all heads in Chinese phrases go: on the right side.  It treats 你刚说 as if it were modifying the head, and puts it where all modifiers (attributives) go in Chinese phrases: on the left side.

Notice that this is exactly parallel to how adjective - noun phrases are treated in Chinese:

the red | _ | pen
紅色 | 的 | 筆

So Chinese treats this kind of adjectival phrase in the same way that it treats relative clauses. This is very logical, since in both phrases the descriptive part and the head part get the exact same treatment. 

English, on the other hand, is weirdly inconsistent, putting head first in relative clauses and head last in adjectival phrases, where it doesn't even bother to mark which is which.  

In both these cases in Chinese the 的 is required. To omit it will confuse people and even if they can figure out what you mean, they will feel you have said something very odd.